GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Skip OIO transport from FileRegion drain-loop overshoot test · netty/netty@088ebed

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • testsuite/src/main/java/io/netty/testsuite/transport/socket
    • SocketFileRegionTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketFileRegionTest.java‎

Copy file name to clipboardExpand all lines: testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketFileRegionTest.java
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import io.netty.channel.DefaultFileRegion;
2727
import io.netty.channel.FileRegion;
2828
import io.netty.channel.SimpleChannelInboundHandler;
29+
import io.netty.channel.socket.oio.OioSocketChannel;
2930
import io.netty.util.AbstractReferenceCounted;
3031
import io.netty.util.internal.ObjectUtil;
3132
import io.netty.util.internal.PlatformDependent;
@@ -49,6 +50,7 @@
4950
import static org.junit.jupiter.api.Assertions.assertEquals;
5051
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
5152
import static org.junit.jupiter.api.Assertions.assertNotEquals;
53+
import static org.junit.jupiter.api.Assumptions.assumeFalse;
5254
import static org.junit.jupiter.api.Assumptions.assumeTrue;
5355

5456
public class SocketFileRegionTest extends AbstractSocketTest {
@@ -215,6 +217,15 @@ protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) {
215217
Channel sc = sb.bind().sync().channel();
216218
Channel cc = cb.connect(sc.localAddress()).sync().channel();
217219
try {
220+
// OioByteStreamChannel#doWriteFileRegion drains using a locally-tracked
221+
// bytes-written counter as the transferTo position (ignoring transferred()), so an
222+
// ill-behaved FileRegion that advances transferred() past actual bytes written --
223+
// the exact pattern this fixture uses to exercise the overshoot path -- cannot
224+
// satisfy OIO's loop without violating the position invariant. The overshoot
225+
// detection is meaningless on OIO for the same reason; skip the permutation.
226+
assumeFalse(cc instanceof OioSocketChannel,
227+
"OIO transport does not honour transferred() for drain-loop termination");
228+
218229
OvershootDetectingFileRegion region = new OvershootDetectingFileRegion(regionSize);
219230
// sync() blocks until the write future completes, by which point every
220231
// transferTo() call the transport is going to make has already been made --

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.