Stop emit verb tests from hanging on Linux/Mac CI agents#2943
Merged
Conversation
Two tests left InputFilePath null (or omitted) to exercise the empty-payload diagnostic, trusting that Console.OpenStandardInput().ReadToEnd() returns an empty string on every platform when xUnit redirects stdin. That holds on Windows but not on the ADO Linux/Mac agents: the runner's stdin pipe stays open without ever sending EOF, so ReadToEnd() blocks and the test assembly hangs. The ADO release pipeline observed exactly this on main after PR #2942 merged - Test.UnitTests.Sarif.dll finished, then the multitool assembly never returned. Repoint both tests at an empty input file. TryReadJsonPayload's file branch reads the file, finds the JSON empty, and emits the same 'is empty' diagnostic the stdin branch would have - so the assertion is unchanged - and the stdin code path is never touched, making the test portable across agents. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
cfaucon
approved these changes
May 26, 2026
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.
Two tests left
InputFilePathnull to exercise the empty-payload diagnostic viaConsole.OpenStandardInput().ReadToEnd(). That returns empty under xUnit on Windows but blocks indefinitely on the ADO Linux/Mac agents — their stdin pipe stays open without EOF. The release pipeline on main hung exactly there after #2942 merged:Test.UnitTests.Sarif.dllfinished,Test.UnitTests.Sarif.Multitool.Library.dllnever returned.Repoint both tests at an empty input file:
TryReadJsonPayload's file branch hits the same"<Kind> JSON is empty"diagnostic, assertions unchanged, stdin path never touched.Production users are unaffected — interactive shells report
IsInputRedirected = false, piped shells send EOF cleanly. Test-environment artifact only.