Repository navigation
Give the host-side kill of a WSL tool time to finish - #953
Merged
Merged
Conversation
Closing a Windows tool from inside WSL runs Windows PowerShell on the host, and shared the five second wait given to the programs that describe the host. A cold PowerShell on a build agent under WSL 1 took longer, so the tool was left open and the wsl 1 job failed. The kill has a thirty second wait of its own, and asks Windows for the tool's processes by image rather than for every process. The tests that run the script no longer hold a thread while PowerShell starts, and take its error stream instead of letting it into the test log.
A test that fails on time alone cannot be explained from the log, which says how long it took and nothing about what ran beside it. The report has when every test started and ended.
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.
Fixes the failed build of
mainat ad076ab (#952), where two jobs failed.wsl 1: the kill timed outWslLiveTests.AStartedToolIsFoundByItsCommandAndEndedOnTheHostfailed becauseWslInterop.Killreturned false. The kill runs Windows PowerShell on the host throughWslHost.Run, which gave up after five seconds, and the test took 6.9. On a build agent a cold PowerShell is several seconds slower than on a developer machine: the same class took about four seconds there against 1.3 locally, so five was marginal.That is a product problem as well as a test one, since a slow or cold machine left a user's tool open the same way.
windows: a timing test stalledViewerProtocolTests.AnUnresponsiveOwnerTimesOutRatherThanHangingexpects a one second timeout to return within fifteen and took twenty one. It did not reproduce in four local runs limited to two processors, and the same suite had passed on the three runs before.A possible contributor, not proven:
WslKillScriptTestsheld a thread pool thread for as long as each of its four PowerShell runs took, which on an agent is seconds. They now read PowerShell's output asynchronously and poll for the stand-in's exit, so no thread is held. They also take PowerShell's error stream, which was writing its first-run progress into the test log.Checked
wsl 1job on this PR is the check.