pytestadapter: Read pipe in non-blocking mode so tests don't hang if the subprocess fails to open the pipe for writing. - #25725
Gary van der Merwe (garyvdm) wants to merge 3 commits into
Conversation
|
@microsoft-github-policy-service agree |
…ipe code encapuslated.
…the subprocess fails to open the pipe for writing.
999c9f6 to
31e861a
Compare
|
I'm not sure why I'm not getting any responses on this PR. Is there some requirement on PR's that I missed? Thanks |
|
Thank you for investigating the pipe hang and putting together this fix. Avoiding a blocking read when the subprocess fails to open the pipe is still a useful goal. Since this PR was opened, though, the pytest adapter helper and pipe-handling code have changed considerably, so the current branch would require a substantial rebase and likely a more focused reimplementation against the latest code. I’m going to close this PR for now to keep the queue representative of work that can move forward as written. This does not mean the underlying fix is unwanted: if you’re still interested, you’re very welcome to revise this PR or open a smaller replacement based on the latest main! Lmk if you have questions |
When running the pytest adapter tests, if subprocess fails to open the pipe for writing, then the the open call for reading the pipe blocks, and the tests hang. This PR fixes that by using non-blocking IO when reading the pipe. This should make debugging the tests easier.
This also address 2 other minor issues: