Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http-netty: Fix flaky FullDuplexAndSequentialModeTest #3070

Merged
merged 3 commits into from
Sep 30, 2024

Conversation

bryce-anderson
Copy link
Contributor

Motivation:

This test suite has been flaky for a while. As detailed in issue #1894, this is because under some conditions the test running thread ends up waiting on a latch that it is actually responsible to release.

Modifications:

Make sure the publishing of the InputStreamPublisher happens in on a different thread so we don't end up in deadlock.

Fixes #1894

Motivation:

This test suite has been flaky for a while. As detailed in issue apple#1894,
this is because under some conditions the test running thread ends up
waiting on a latch that it is actually responsible to release.

Modifications:

Make sure the publishing of the InputStreamPublisher happens in on a
different thread so we don't end up in deadlock.

Fixes apple#1894
CountDownLatch continueRequest,
InputStream payload) {
return connection.request(connection.post(SVC_ECHO).payloadBody(fromInputStream(payload, CHUNK_SIZE)
return connection.request(connection.post(SVC_ECHO).payloadBody(fromInputStream(payload, 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did the CHUNK_SIZE change from 1024 to 1 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if it stays what it was the assertThrows(..) doesn't happen. I suspect we end up racing the cancellation in the separate thread.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, knowing the reason, I'm agreed that smaller chunk makes it likely to happen we end up in a deadlock. For the original purpose of the test, it should not matter though. So, I don't mind if we change the size here or not.

@bryce-anderson
Copy link
Contributor Author

CI failures are known flaky tests. Merging.

@bryce-anderson bryce-anderson merged commit cc0fa91 into apple:main Sep 30, 2024
9 of 11 checks passed
@bryce-anderson bryce-anderson deleted the bl_anderson/flaky-test_1894 branch September 30, 2024 17:15
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.

Flaky Test: FullDuplexAndSequentialModeTest
3 participants