Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

test_multiprocessing_fork: test_nested_startmethod() fails randomly. #109706

Copy link
Copy link
@vstinner

Description

@vstinner
Issue body actions

test_nested_startmethod() fails randomly. Since there is no synchronization, putting items in the queue is not really ordered.

I suggest to either accept [1, 2] and [2, 1] in the test, or add some kind of synchronization to ensure that events happen in the expected order. Here I don't think that order matters.

The test was added by PR #108568 of issue gh-108520.

FAIL: test_nested_startmethod (test.test_multiprocessing_fork.test_misc.TestStartMethod.test_nested_startmethod)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-ppc64le.lto/build/Lib/test/_test_multiprocessing.py", line 5475, in test_nested_startmethod
    self.assertEqual(results, [2, 1])
AssertionError: Lists differ: [1, 2] != [2, 1]

First differing element 0:
1
2

- [1, 2]
+ [2, 1]

build: https://buildbot.python.org/all/#/builders/503/builds/3941

The failure can be reproduced by stressing the test:

$ ./python -m test test_multiprocessing_fork.test_misc -m test_nested_startmethod -v -j50 --forever
(...)
0:00:24 load avg: 20.03 [157/1] test_multiprocessing_fork.test_misc failed (1 failure)
test_nested_startmethod (test.test_multiprocessing_fork.test_misc.TestStartMethod.test_nested_startmethod) ... FAIL

======================================================================
FAIL: test_nested_startmethod (test.test_multiprocessing_fork.test_misc.TestStartMethod.test_nested_startmethod)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vstinner/python/3.11/Lib/test/_test_multiprocessing.py", line 5399, in test_nested_startmethod
    self.assertEqual(results, [2, 1])
AssertionError: Lists differ: [1, 2] != [2, 1]

First differing element 0:
1
2

- [1, 2]
+ [2, 1]

----------------------------------------------------------------------
Ran 1 test in 2.150s

FAILED (failures=1)
test test_multiprocessing_fork.test_misc failed

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirTests in the Lib/test dir
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.