Skip to content

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

Description

@vstinner

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

Activity

  1. vstinner commented on Sep 14, 2023

    @vstinner
    MemberAuthor

    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

  2. added 4 commits that reference this issue on Sep 25, 2023
  3. added 2 commits that reference this issue on Sep 26, 2023
  4. vstinner commented on Sep 26, 2023

    @vstinner
    MemberAuthor

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

  5. added a commit that references this issue on Sep 26, 2023
  6. added a commit that references this issue on Sep 28, 2023
  7. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions