Skip to content

Auto-port 4.1: Fix flaky HTTP/2 test#16348

Merged
chrisvest merged 1 commit into
4.1from
auto-port-pr-16342-to-4.1
Feb 25, 2026
Merged

Auto-port 4.1: Fix flaky HTTP/2 test#16348
chrisvest merged 1 commit into
4.1from
auto-port-pr-16342-to-4.1

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #16342 to 4.1
Cherry-picked commit: 98284f5


Motivation:
The LastInboundHandler.queue is a plain ArrayList, but tests access and modify it from both within event loops and test methods.

Modification:
Put all accesses in synchronized blocks.

Result:
Accesses to the queue is now thread-safe.
No more flaky test failures from unsafe concurrent access to the queue.

I considered changing it to a concurrent or blocking queue. However, the logic around UserEvents makes this difficult to do while preserving the exact behavior that tests might expect.

Motivation:
The `LastInboundHandler.queue` is a plain `ArrayList`, but tests access
and modify it from both within event loops and test methods.

Modification:
Put all accesses in `synchronized` blocks.

Result:
Accesses to the queue is now thread-safe.
No more flaky test failures from unsafe concurrent access to the queue.

I considered changing it to a concurrent or blocking queue. However, the
logic around `UserEvents` makes this difficult to do while preserving
the exact behavior that tests might expect.

(cherry picked from commit 98284f5)
@chrisvest chrisvest added this to the 4.1.132.Final milestone Feb 25, 2026
@chrisvest chrisvest merged commit 590aef2 into 4.1 Feb 25, 2026
16 of 18 checks passed
@chrisvest chrisvest deleted the auto-port-pr-16342-to-4.1 branch February 25, 2026 01:29
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