Fix flaky ResponseCancelTest#2337
Merged
idelpivnitskiy merged 4 commits intoapple:mainfrom Sep 29, 2022
Merged
Conversation
Scottmitch
approved these changes
Aug 31, 2022
servicetalk-http-netty/src/test/java/io/servicetalk/http/netty/ResponseCancelTest.java
Show resolved
Hide resolved
Member
|
https://github.com/apple/servicetalk/runs/8104135574?check_suite_focus=true |
Motivation: apple#2297 indicates that `ResponseCancelTest` sometimes fails. It happens because we incorrectly request signals from `delayedClientTermination` queue. After cancel we may or may not see a terminal event. In rare cases, `StacklessClosedChannelException` is propagated to the subscriber after cancel. The next request does not assume that there is a pending `ClientTerminationSignal` in the queue and considers this exception as failure for a new request. Modifications: - Introduce a `requestId` to associate `ClientTerminationSignal` with a proper request; - Discard signals for prior requests inside `resume` logic; - Wrap `signal.err` with `AssertionError` to preserve a caller stack trace; Result: Fixes apple#2297.
5759aa5 to
6a3b2bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
#2297 indicates that
ResponseCancelTestsometimes fails. It happensbecause we incorrectly request signals from
delayedClientTerminationqueue. After cancel we may or may not see a terminal event. In rare
cases,
StacklessClosedChannelExceptionis propagated to the subscriberafter cancel. The next request does not assume that there is a pending
ClientTerminationSignalin the queue and considers this exception asfailure for a new request.
Modifications:
requestIdto associateClientTerminationSignalwitha proper request;
resumelogic;signal.errwithAssertionErrorto preserve a caller stacktrace;
Result:
Fixes #2297.