fix(test): stop the OAuth callback tests losing a failure to the zone - #89
Open
winetree94 wants to merge 1 commit into
Open
fix(test): stop the OAuth callback tests losing a failure to the zone#89winetree94 wants to merge 1 commit into
winetree94 wants to merge 1 commit into
Conversation
The gateway fails a browser session while it is still answering the callback request, so the three denial tests attached their expectation after awaiting a real socket round trip. For the length of that read the error on session.completion had no handler, and the runner reported it as an unhandled async error rather than the failure the test was asserting. macOS and Windows lost the race often enough to redden main. The expectations now start watching before the round trip.
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.
What
mainis red onDart tests, and PR #85 cannot merge behind it. The failure isopenai_oauth_gateway_test.dart: the callback page escapes provider-supplied text, reported as a bare exception rather than a failed expectation:That is an unhandled async error, not an assertion.
_completeBrowserfails the session while it is still answering the callback request, but all three denial tests attached theirexpectLateronly after awaiting the HTTP round trip. For the length of a real socket read the error onsession.completionhad no handler, so the zone reported it and the runner failed the test. Linux wins the race consistently; macOS and Windows do not.The three affected tests now start watching
session.completionbefore triggering the callback. No assertion is weakened or removed — the same matchers run, just with the handler attached in time.Verification
dart test test/openai_oauth_gateway_test.dart×3 with randomized ordering, all greendart analyze --fatal-infos packages/coder_daemon,dart formatclean