Repository navigation
Make the timed-out salvage test outlast the launch it races - #2116
Merged
Merged
Conversation
The P2.2 salvage test gave its run a 1s wall deadline and expected the agent's write to land before the kill. The deadline is armed when the launch is bound, before the runner host's broker, exec bootstrap and guardian start and before /bin/sh runs. On a loaded host that launch alone took 1.0-2.0s, so the kill sometimes landed before the write and the test failed with an empty ChangedFiles. That read as broken salvage when salvage was never exercised. It failed this way twice on CI. The deadline is now 10s. The script echoes "written" once the file is on disk and only then sleeps, and the test reads that line back through the run's recorded events before it checks the capture. If a launch ever overruns the deadline again, the failure names the launch instead of blaming salvage.
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.
Summary
AgentBranchPushFlowTests.P2_2_a_timed_out_run_salvages_its_real_edit_as_a_real_pushed_branchgave its run a 1s wall deadline. That deadline is armed when the launch is bound (LocalProcessRunner.NativeLaunch.cs:76), before the runner host's broker, exec bootstrap and guardian processes start and before/bin/shruns. On a loaded host the launch alone took 1.0–2.0s, so the kill sometimes landed before the agent's write. The test then failed with an emptyChangedFiles, which looked like broken salvage even though salvage never ran.printf ... > salvaged.txt && echo written; sleep 300, and the test readswrittenback through the run's recorded events (IAgentRunService.GetEventsAsync) before it checks the capture. If a launch ever overruns the deadline, the failure says so instead of blaming salvage. Everything the test proves is unchanged: the run endsTimedOut, the file is inChangedFiles, and the branch is really pushed to the bare remote and contains the file.Test plan
ChangedFiles ... but was actually []TimedOutfrom the salvage push gate inPushProducedBranchIfEnabledAsync→ red atProducedBranchEnrichWithWorkspaceChangesAsyncforTimedOut→ red atChangedFiles, after thewrittenprecondition passeswrittenprecondition, with a message that names the launch overrunAgentBranchPushFlowTestsclass: 4/4 green