Skip to content

gh-129158: Ensure we restore unix_events.can_use_pidfd after SubprocessThreadedWatcherTests finishes #129160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Lib/test/test_asyncio/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,9 +901,14 @@ def test_watcher_implementation(self):
class SubprocessThreadedWatcherTests(SubprocessWatcherMixin,
test_utils.TestCase):
def setUp(self):
self._original_can_use_pidfd = unix_events.can_use_pidfd
# Force the use of the threaded child watcher
unix_events.can_use_pidfd = mock.Mock(return_value=False)
super().setUp()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pablogsal Why did you merge this without this line fix? I had suggested it to fix the lint CI and now it is broken on main too. https://github.com/python/cpython/actions/runs/12908528443/job/35994236140

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged this from my phone and I didn't see the comment. Apologies!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry I will make a PR fixing this in the next hour

Copy link
Member

@picnixz picnixz Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made #129180 (sorry didn't see your comment before...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry :)

def tearDown(self):
unix_events.can_use_pidfd = self._original_can_use_pidfd
return super().tearDown()

@unittest.skipUnless(
unix_events.can_use_pidfd(),
Expand Down
Loading