Skip to content
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

[Windows] test_subprocess: test_close_fds_with_stdio() has a race condition #80884

Closed
vstinner opened this issue Apr 23, 2019 · 4 comments
Closed

Comments

@vstinner
Copy link
Member

BPO 36703
Nosy @vstinner, @pablogsal

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2019-04-23.08:00:42.062>
labels = ['easy']
title = '[Easy][Windows] test_subprocess: test_close_fds_with_stdio() has a race condition'
updated_at = <Date 2019-04-23.08:07:54.823>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2019-04-23.08:07:54.823>
actor = 'vstinner'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = []
creation = <Date 2019-04-23.08:00:42.062>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 36703
keywords = ['easy']
message_count = 1.0
messages = ['340698']
nosy_count = 2.0
nosy_names = ['vstinner', 'pablogsal']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue36703'
versions = []

@vstinner
Copy link
Member Author

test_subprocess: test_close_fds_with_stdio() pass when run alone, but fail when run in parallel.

I tagged the issue as "easy" for new contributors to Python. If someone is interested to work on this issue, please contact me in private.

https://buildbot.python.org/all/#/builders/3/builds/2446

I can reproduce the issue.

The test pass when run alone:

python -m test test_subprocess -m test_close_fds_with_stdio -v
Running Debug|x64 interpreter...
== CPython 3.7.3+ (heads/3.7:9344d74f7b, Apr 23 2019, 09:53:41) [MSC v.1915 64 bit (AMD64)]
== Windows-10-10.0.17763-SP0 little-endian
== cwd: C:\vstinner\python\3.7\build\test_python_6116
== CPU count: 2
== encodings: locale=cp1252, FS=utf-8
Run tests sequentially
0:00:00 [1/1] test_subprocess
test_close_fds_with_stdio (test.test_subprocess.Win32ProcessTestCase) ... ok

----------------------------------------------------------------------

Ran 1 test in 0.302s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 391 ms
Tests result: SUCCESS

But the test fails when run in parallel:

> python -m test test_subprocess -m test_close_fds_with_stdio -F -j4
Running Debug|x64 interpreter...
Run tests in parallel using 4 child processes
0:00:01 [  1/1] test_subprocess failed
test test_subprocess failed -- Traceback (most recent call last):
  File "C:\vstinner\python\3.7\lib\test\test_subprocess.py", line 2930, in test_close_fds_with_stdio
    self.assertEqual(p.returncode, 1)
AssertionError: 0 != 1
0:00:01 [  2/1] test_subprocess passed
0:00:01 [  3/2] test_subprocess failed
test test_subprocess failed -- Traceback (most recent call last):
  File "C:\vstinner\python\3.7\lib\test\test_subprocess.py", line 2930, in test_close_fds_with_stdio
    self.assertEqual(p.returncode, 1)
AssertionError: 0 != 1
0:00:01 [  4/3] test_subprocess failed
test test_subprocess failed -- Traceback (most recent call last):
  File "C:\vstinner\python\3.7\lib\test\test_subprocess.py", line 2942, in test_close_fds_with_stdio
    self.assertEqual(p.returncode, 1)
AssertionError: 0 != 1
0:00:02 [  5/3] test_subprocess passed
0:00:02 [  6/3] test_subprocess passed

== Tests result: FAILURE ==

3 tests OK.

3 tests failed:
test_subprocess test_subprocess test_subprocess

Total duration: 2 sec 313 ms
Tests result: FAILURE

@vstinner vstinner added the easy label Apr 23, 2019
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@sweeneyde
Copy link
Member

It looks like this has been popping up more and might be the cause of recent buildbot failures.

@vstinner vstinner removed the easy label May 2, 2022
@vstinner vstinner changed the title [Easy][Windows] test_subprocess: test_close_fds_with_stdio() has a race condition [Windows] test_subprocess: test_close_fds_with_stdio() has a race condition May 2, 2022
@vstinner
Copy link
Member Author

vstinner commented May 2, 2022

3 years later, it's still not fixed. I removed the "easy" tag.

@vstinner
Copy link
Member Author

vstinner commented Nov 3, 2022

I didn't see this failure recently. I close the issue.

@vstinner vstinner closed this as completed Nov 3, 2022
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

No branches or pull requests

2 participants