Skip to content

[3.12] gh-109888: Fix test_os _kill_with_event() on Windows (GH-110421) #110442

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
Oct 5, 2023

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 5, 2023

Replace os.kill() with proc.kill() which catchs PermissionError.

Rewrite _kill_with_event():

  • Use subprocess context manager ("with proc:").
  • Use sleeping_retry() to wait until the child process is ready.
  • Replace SIGINT with proc.kill() on error.
  • Replace 10 seconds with SHORT_TIMEOUT to wait until the process is
    ready.
  • Replace 0.5 seconds with SHORT_TIMEOUT to wait for the process
    exit.
    (cherry picked from commit aaf297c)

Co-authored-by: Victor Stinner [email protected]

…110421)

Replace os.kill() with proc.kill() which catchs PermissionError.

Rewrite _kill_with_event():

* Use subprocess context manager ("with proc:").
* Use sleeping_retry() to wait until the child process is ready.
* Replace SIGINT with proc.kill() on error.
* Replace 10 seconds with SHORT_TIMEOUT to wait until the process is
  ready.
* Replace 0.5 seconds with SHORT_TIMEOUT to wait for the process
  exit.
(cherry picked from commit aaf297c)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-app bedevere-app bot added tests Tests in the Lib/test dir awaiting review labels Oct 5, 2023
@vstinner vstinner enabled auto-merge (squash) October 5, 2023 21:41
@vstinner vstinner merged commit 6af359b into python:3.12 Oct 5, 2023
@miss-islington miss-islington deleted the backport-aaf297c-3.12 branch October 5, 2023 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants