Skip to content

pytestadapter: Read pipe in non-blocking mode so tests don't hang if the subprocess fails to open the pipe for writing. - #25725

Closed
Gary van der Merwe (garyvdm) wants to merge 3 commits into
microsoft:mainfrom
garyvdm:test_non_block_io
Closed

Gary van der Merwe (garyvdm) wants to merge 3 commits into
microsoft:mainfrom
garyvdm:test_non_block_io

Conversation

@garyvdm

@garyvdm Gary van der Merwe (garyvdm) commented Jan 10, 2026

Copy link
Copy Markdown

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:

  • Remove unused code for listening on a unix socket.
  • Refactor test runner to make platform specific named pipe code encapsulated.

@garyvdm

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@garyvdm

Copy link
Copy Markdown
Author

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

@eleanorjboyd

Copy link
Copy Markdown
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants