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

test_threading: test_default_timeout() fails randomly ands logs "Warning -- Unraisable exception" #109401

Closed
vstinner opened this issue Sep 14, 2023 · 2 comments
Labels
tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

vstinner commented Sep 14, 2023

Example from issue #108987:

test_default_timeout (test.test_threading.BarrierTests.test_default_timeout)
Test the barrier's default timeout ... Warning -- Unraisable exception
Exception ignored in thread started by: <function Bunch.__init__.<locals>.task at 0x053F5270>
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\lock_tests.py", line 48, in task
    f()
  File "D:\a\cpython\cpython\Lib\test\lock_tests.py", line 1020, in f
    i = barrier.wait()
        ^^^^^^^^^^^^^^
  File "D:\a\cpython\cpython\Lib\threading.py", line 709, in wait
    self._wait(timeout)
  File "D:\a\cpython\cpython\Lib\threading.py", line 749, in _wait
    raise BrokenBarrierError
threading.BrokenBarrierError: 
ERROR
test_repr (test.test_threading.BarrierTests.test_repr) ... Warning -- Unraisable exception
Exception ignored in thread started by: <function Bunch.__init__.<locals>.task at 0x053F5270>
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\lock_tests.py", line 48, in task
    f()
  File "D:\a\cpython\cpython\Lib\test\lock_tests.py", line 1020, in f
    i = barrier.wait()
        ^^^^^^^^^^^^^^
  File "D:\a\cpython\cpython\Lib\threading.py", line 709, in wait
    self._wait(timeout)
  File "D:\a\cpython\cpython\Lib\threading.py", line 749, in _wait
    raise BrokenBarrierError
threading.BrokenBarrierError: 
Warning -- Unraisable exception
Exception ignored in thread started by: <function Bunch.__init__.<locals>.task at 0x053F5270>
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\lock_tests.py", line 48, in task
    f()
  File "D:\a\cpython\cpython\Lib\test\lock_tests.py", line 1020, in f
    i = barrier.wait()
        ^^^^^^^^^^^^^^
  File "D:\a\cpython\cpython\Lib\threading.py", line 709, in wait
    self._wait(timeout)
  File "D:\a\cpython\cpython\Lib\threading.py", line 749, in _wait
    raise BrokenBarrierError
threading.BrokenBarrierError: 
Warning -- Unraisable exception
Exception ignored in thread started by: <function Bunch.__init__.<locals>.task at 0x053F5270>
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\lock_tests.py", line 48, in task
    f()
  File "D:\a\cpython\cpython\Lib\test\lock_tests.py", line 1020, in f
    i = barrier.wait()
        ^^^^^^^^^^^^^^
  File "D:\a\cpython\cpython\Lib\threading.py", line 700, in wait
    self._enter() # Block while the barrier drains.
    ^^^^^^^^^^^^^
  File "D:\a\cpython\cpython\Lib\threading.py", line 724, in _enter
    raise BrokenBarrierError
threading.BrokenBarrierError: 
ok

build: https://github.com/python/cpython/actions/runs/6094370280/job/16535778004#step:5:103

In issue #108987, I fixed a crashed which occurred in this test when the test failed.

I create this issue to focus on the test failure and Warning -- Unraisable exception.

Linked PRs

@vstinner
Copy link
Member Author

Issue #108987 contains instructions on how to reproduce the bug and which platforms are affected. The test failure seems to be way more likely on Windows.

cc @serhiy-storchaka

@vstinner vstinner added the tests Tests in the Lib/test dir label Sep 20, 2023
vstinner added a commit to vstinner/cpython that referenced this issue Sep 25, 2023
Increase timeouts. Barrier default timeout should be long enough to
spawn 4 threads on a slow CI.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 25, 2023
Increase timeouts. Barrier default timeout should be long enough to
spawn 4 threads on a slow CI.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 25, 2023
Increase timeouts. Barrier default timeout should be long enough to
spawn 4 threads on a slow CI.
vstinner added a commit that referenced this issue Sep 26, 2023
Increase timeouts. Barrier default timeout should be long enough to
spawn 4 threads on a slow CI.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 26, 2023
…GH-109875)

Increase timeouts. Barrier default timeout should be long enough to
spawn 4 threads on a slow CI.
(cherry picked from commit e5186c3)

Co-authored-by: Victor Stinner <vstinner@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 26, 2023
…GH-109875)

Increase timeouts. Barrier default timeout should be long enough to
spawn 4 threads on a slow CI.
(cherry picked from commit e5186c3)

Co-authored-by: Victor Stinner <vstinner@python.org>
@vstinner
Copy link
Member Author

Commit e5186c3 is not a fix. It only increases timeouts. Let's see how it goes.

vstinner added a commit that referenced this issue Sep 26, 2023
…9875) (#109877)

gh-109401: Fix threading barrier test_default_timeout() (GH-109875)

Increase timeouts. Barrier default timeout should be long enough to
spawn 4 threads on a slow CI.
(cherry picked from commit e5186c3)

Co-authored-by: Victor Stinner <vstinner@python.org>
csm10495 pushed a commit to csm10495/cpython that referenced this issue Sep 28, 2023
…#109875)

Increase timeouts. Barrier default timeout should be long enough to
spawn 4 threads on a slow CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

No branches or pull requests

1 participant