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

Fix Cancel On Loss Test's Race Condition #4121

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

nibanks
Copy link
Member

@nibanks nibanks commented Feb 8, 2024

Description

Fixes a race condition in the test code where it set a completion event before the return code, so the main thread that waits on the event and validates the code some times fails.

Also fixed a number of style nits.

Testing

Locally. CI/CD

Documentation

N/A

@nibanks nibanks requested a review from a team as a code owner February 8, 2024 14:48
@nibanks nibanks added the Bug: Test/Tool Code bug in the test or tool specific code. label Feb 8, 2024
Comment on lines -1421 to +1414
TestContext->SendPhaseEndedEvent.Set();
TestContext->ExitCode = CancelOnLossContext::SuccessExitCode;
TestContext->SendPhaseEndedEvent.Set();
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the real fix.

Comment on lines -1427 to +1420
TestContext->SendPhaseEndedEvent.Set();
TestContext->ExitCode = Event->PEER_SEND_ABORTED.ErrorCode;
} else {
Status = QUIC_STATUS_INVALID_STATE;
TestContext->SendPhaseEndedEvent.Set();
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the real fix.

@nibanks nibanks enabled auto-merge (squash) February 8, 2024 14:49
@nibanks nibanks merged commit 0a0461c into main Feb 8, 2024
342 of 344 checks passed
@nibanks nibanks deleted the nibanks/cancel-on-loss-race-condition branch February 8, 2024 19:04
nibanks added a commit that referenced this pull request Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Test/Tool Code bug in the test or tool specific code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants