Skip to content

Http2ConnectionRoundtripTest: Reduce timing sensitivity to fix CI flakiness (#17540) - #17552

Merged
normanmaurer merged 1 commit into
4.1from
h2_flaky4
Sep 20, 2026
Merged

normanmaurer merged 1 commit into
4.1from
h2_flaky4

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:

We saw sporadic CI failures in Http2ConnectionRoundtripTest where a
CountDownLatch.await(...) timed out even though the connection was
behaving correctly. Each test method spins up two
MultiThreadIoEventLoopGroups with the default thread count
(2 * available processors), even though the test only exercises
LocalChannel and never needs more than one thread per group. Combined
with this module running JUnit5 tests concurrently, this can create
significant thread oversubscription and starve the event loop long
enough to blow the 15 second timeout under load. This was reproduced
locally by running many instances of the test concurrently while the
machine was under heavy CPU load, which reliably reproduced the same
kind of timeout failure seen on CI.

Modifications:

  • Pin the client and server MultiThreadIoEventLoopGroups in
    bootstrapEnv(...) to a single thread each instead of the default,
    since LocalChannel does not benefit from extra threads.
  • Increase DEFAULT_AWAIT_TIMEOUT_SECONDS from 15 to 30 seconds to give
    more headroom under CI load.

Result:

Less flaky Http2ConnectionRoundtripTest.

…kiness (#17540)

Motivation:

We saw sporadic CI failures in Http2ConnectionRoundtripTest where a
CountDownLatch.await(...) timed out even though the connection was
behaving correctly. Each test method spins up two
MultiThreadIoEventLoopGroups with the default thread count
(2 * available processors), even though the test only exercises
LocalChannel and never needs more than one thread per group. Combined
with this module running JUnit5 tests concurrently, this can create
significant thread oversubscription and starve the event loop long
enough to blow the 15 second timeout under load. This was reproduced
locally by running many instances of the test concurrently while the
machine was under heavy CPU load, which reliably reproduced the same
kind of timeout failure seen on CI.

Modifications:

- Pin the client and server MultiThreadIoEventLoopGroups in
  bootstrapEnv(...) to a single thread each instead of the default,
  since LocalChannel does not benefit from extra threads.
- Increase DEFAULT_AWAIT_TIMEOUT_SECONDS from 15 to 30 seconds to give
  more headroom under CI load.

Result:

Less flaky Http2ConnectionRoundtripTest.
@testlens-app

testlens-app Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 7dd96c0
▶️ Tests: 400177 executed
⚪️ Checks: 18/18 completed


Learn more about TestLens at testlens.app/docs.

@normanmaurer
normanmaurer merged commit 1eab46c into 4.1 Sep 20, 2026
19 checks passed
@normanmaurer
normanmaurer deleted the h2_flaky4 branch September 20, 2026 11:05
@normanmaurer normanmaurer added this to the 4.1.139.Final milestone Sep 20, 2026
lltopk pushed a commit to lltopk/netty that referenced this pull request Oct 24, 2026
…kiness (netty#17540) (netty#17552)

Motivation:

We saw sporadic CI failures in Http2ConnectionRoundtripTest where a
CountDownLatch.await(...) timed out even though the connection was
behaving correctly. Each test method spins up two
MultiThreadIoEventLoopGroups with the default thread count
(2 * available processors), even though the test only exercises
LocalChannel and never needs more than one thread per group. Combined
with this module running JUnit5 tests concurrently, this can create
significant thread oversubscription and starve the event loop long
enough to blow the 15 second timeout under load. This was reproduced
locally by running many instances of the test concurrently while the
machine was under heavy CPU load, which reliably reproduced the same
kind of timeout failure seen on CI.

Modifications:

- Pin the client and server MultiThreadIoEventLoopGroups in
  bootstrapEnv(...) to a single thread each instead of the default,
  since LocalChannel does not benefit from extra threads.
- Increase DEFAULT_AWAIT_TIMEOUT_SECONDS from 15 to 30 seconds to give
  more headroom under CI load.

Result:

Less flaky Http2ConnectionRoundtripTest.
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.

1 participant