De-flake TestExecSource on Windows - #491
Merged
Merged
Conversation
Fixed sleeps lose to PowerShell start-up times on loaded CI runners: await the source counter instead. `Get-Content -Wait` keeps the process alive like `tail -f`, so the batch timeout, not the EOF flush, delivers the events. Writing the input file before the source starts removes the race with the one-shot read of the old command. Assisted-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zsFn1f2B32vcNoCeZSfn7
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.
TestExecSource.testBatchTimeoutfails intermittently on the Windows runner (e.g. this run). Three causes, all Windows-specific or Windows-amplified:ExecSource#getSourceCounter(), following theSyslogTcpSourceprecedent. This also cuts ~20 s of unconditional sleeping from the suite (~41 s → ~15 s).source.start(), but the Windows commandGet-Content <file> | Select-Object -Last 10is a one-shot read: it sees whatever happens to be in the file when PowerShell gets to it. The file is now fully written before the source starts.Get-Content -Tail 10 -Waitis the realtail -fequivalent: the process stays alive and only the timed flush delivers the events.Also replaces the hard-coded
/tmppath, which only worked on Windows by accident, with a real temporary file.