Repository navigation
Start the gateway outage test's outage after the agent's session report lands - #722
Merged
Merged
Conversation
…rt lands The test that has a gateway answer 502 while Chopin is away moved its fake clock four seconds for every refused request and ended the outage after eight. It expected all eight to come from the heartbeat, but the agent's session report is sent when the agent starts, and on a fast runner that happened during the outage. Each of the report's retries registered the machine again, was refused, and moved the clock and the count, so the heartbeat printed different attempt numbers and elapsed times, or stopped before its sixth attempt. Chopin now goes away only after it has heard the agent's session, so the heartbeat makes every refused request and the printed lines are the same on every run. Waiting for the agent before the outage makes the test longer, so it gets a 10 second budget, as other slow tests in the file do. Assistant-model: Claude Opus 5.5 (fast) Assistant-workflow: inline (fast subagents) Assistant-verification: the old test failed 19 of 20 runs with the test process repeatedly paused, including the exact attempt and elapsed-time mismatch seen in CI Assistant-verification: the new test passed 50 plain runs, 50 runs with the test process repeatedly paused, and 50 runs pinned to one CPU beside three busy loops Assistant-verification: bun test apps/connector, bun run types and bun run ci pass Co-authored-by: Alex Lavaee <alexlavaee@microsoft.com>
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.
The connector test "a run behind a gateway answering 502 with no body says HTTP 502 while it retries" failed on unrelated PRs. In one run it printed
attempt 6, 28 swhere it expectedattempt 6, 24 s. In another, theattempt 6line never appeared. Locally it passed.Cause
The fake gateway moved the test's clock four seconds for every refused request and ended the outage after eight. The test expected all eight to come from the heartbeat. But the agent sends its session report (
report_implementation_build, staterunning) when it starts. On a fast runner, that report arrived during the outage. Each of its retries registered the machine again and was refused, which moved the clock and used up one of the eight refusals. The heartbeat then printed other attempt numbers and elapsed times, or the outage ended before its sixth attempt. Both CI failures fit one or two refusals of this kind.The connector is not at fault here: a report retried during an outage should keep trying to reach Chopin.
Fix
This changes only the test. Chopin now goes away only once it has heard the agent's session report. After that, every refused request comes from the heartbeat, so the printed lines are the same on every run, and the exact assertions stay. The test now waits for the agent to start before the outage, so it takes longer and gets a 10 second budget, as other slow tests in the file do.
Evidence
attempt 6, 28 sinstead ofattempt 6, 24 s.bun test apps/connector,bun run typesandbun run cipass.