Fix tests failing with `The process cannot access the file because it is being used by another process` by force-killing child processes

Open
#101,601 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
github-actions, python

Research direction

No file or test entry point is named. Review PR #99464 and the proposed approach in issue #98219 comment 1276753704, then trace the tests that create child processes and share directories. Done means the affected GitHub Actions tests no longer sporadically fail with Windows WinError 32.

Written by the indexing model from the issue text.

Description

tests type-bug

Bug report

GitHub Actions continue to sporadically fail with PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\a\\cpython\\cpython\\build\\test_python_5740�\\test_python_worker_5604�'.

The failure happens when a test creates a child process, shares a test directory with it, and the child outlives its parent.

https://github.com/python/cpython/pull/99464 was the previous attempt. Now we should try to implement https://github.com/python/cpython/issues/98219#issuecomment-1276753704.


Note: this problem was reported a few times before:

Dominant language
Python
Stars
77.2k
Forks
36k
Avg merge
1d 9h
Merged PRs (30d)
558

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python/cpython

All issues in python/cpython

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.