Skip to content

Improve flaky NioSocketChannelTest (#16679)#16681

Merged
normanmaurer merged 3 commits into
4.1from
flaky41
Apr 23, 2026
Merged

Improve flaky NioSocketChannelTest (#16679)#16681
normanmaurer merged 3 commits into
4.1from
flaky41

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:
We've seen IllegalReferenceCountException from this test. This is
probably not the root cause, but the root looks like it is lost in the
pipeline.

Modification:

  • Increase the test timeouts.
  • Add sync() calls so we make sure to wait for the event loop shutdowns
    to complete, before we close the scope of the LeakPresenceDetector.
  • Change an assertNotSame call in a future listener (which runs on the
    event loop) with code that captures the error and funnels it out to the
    test code through a future.

Result:
More debuggable test, maybe more stable too.

Motivation:
We've seen IllegalReferenceCountException from this test. This is
probably not the root cause, but the root looks like it is lost in the
pipeline.

Modification:
- Increase the test timeouts.
- Add sync() calls so we make sure to wait for the event loop shutdowns
to complete, before we close the scope of the LeakPresenceDetector.
- Change an assertNotSame call in a future listener (which runs on the
event loop) with code that captures the error and funnels it out to the
test code through a future.

Result:
More debuggable test, maybe more stable too.
Comment thread transport/src/test/java/io/netty/channel/socket/nio/NioSocketChannelTest.java Outdated
@normanmaurer normanmaurer merged commit 053d084 into 4.1 Apr 23, 2026
32 of 34 checks passed
@normanmaurer normanmaurer deleted the flaky41 branch April 23, 2026 07:58
@normanmaurer normanmaurer added this to the 4.1.133.Final milestone Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants