GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_concurrent_futures: test_as_completed.test_future_times_out() fails on GHA Windows x86 CI · Issue #109565 · python/cpython

test_concurrent_futures: test_as_completed.test_future_times_out() fails on GHA Windows x86 CI #109565

New issue
Copy link
New issue
Copy link
Open
Open
test_concurrent_futures: test_as_completed.test_future_times_out() fails on GHA Windows x86 CI#109565
Copy link
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@vstinner
vstinner
opened on Sep 19, 2023
Issue body actions

Windows x86:

FAIL: test_future_times_out (test.test_concurrent_futures.test_as_completed.ThreadPoolAsCompletedTest.test_future_times_out) [0.01]
Test ``futures.as_completed`` timing out before
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_concurrent_futures\test_as_completed.py", line 60, in test_future_times_out
    self.assertEqual(completed_futures, already_completed)
AssertionError: Items in the first set but not the second:
<Future at 0x5684560 state=finished returned NoneType>

build: https://github.com/python/cpython/actions/runs/6225761937/job/16896880945?pr=108965

The test fails randomly. It passed when re-run in verbose mode in a fresh process:

0:16:02 load avg: 5.55 [2/2/1] test.test_concurrent_futures.test_as_completed passed
Re-running test.test_concurrent_futures.test_as_completed in verbose mode (matching: test_future_times_out)
test_future_times_out (test.test_concurrent_futures.test_as_completed.ProcessPoolForkAsCompletedTest.test_future_times_out)
Test ``futures.as_completed`` timing out before ... skipped 'require unix system'
test_future_times_out (test.test_concurrent_futures.test_as_completed.ProcessPoolForkserverAsCompletedTest.test_future_times_out)
Test ``futures.as_completed`` timing out before ... skipped 'require unix system'
test_future_times_out (test.test_concurrent_futures.test_as_completed.ProcessPoolSpawnAsCompletedTest.test_future_times_out)
Test ``futures.as_completed`` timing out before ... 0.75s ok
test_future_times_out (test.test_concurrent_futures.test_as_completed.ThreadPoolAsCompletedTest.test_future_times_out)
Test ``futures.as_completed`` timing out before ... 0.11s ok

----------------------------------------------------------------------
Ran 4 tests in 0.881s

OK (skipped=2)

Linked PRs

  • gh-109565: Fix concurrent.futures test_future_times_out() #109949
  • [3.12] gh-109565: Fix concurrent.futures test_future_times_out() (GH-109949) #109952

Activity

  1. vstinner
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    on Sep 19, 2023
  2. vstinner commented on Sep 21, 2023

    @vstinner
    vstinner
    on Sep 21, 2023
    MemberAuthor
    More actions

    Test also failed on s390x Fedora 3.x: https://buildbot.python.org/all/#/builders/223/builds/4511

      test_future_times_out (test.test_concurrent_futures.test_as_completed.ThreadPoolAsCompletedTest.test_future_times_out) [0]
    Test ``futures.as_completed`` timing out before ... FAIL
    
    Stdout:
    0.35s 
    test_no_timeout (test.test_concurrent_futures.test_as_completed.ThreadPoolAsCompletedTest.test_no_timeout) ... ok
    
    ======================================================================
    FAIL: test_future_times_out (test.test_concurrent_futures.test_as_completed.ThreadPoolAsCompletedTest.test_future_times_out) [0]
    Test ``futures.as_completed`` timing out before
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z/build/Lib/test/test_concurrent_futures/test_as_completed.py", line 60, in test_future_times_out
        self.assertEqual(completed_futures, already_completed)
    AssertionError: Items in the first set but not the second:
    <Future at 0x3ff9280f1c0 state=finished returned NoneType>
    
  3. elfstrom commented on Sep 27, 2023

    @elfstrom
    elfstrom
    on Sep 27, 2023
    Contributor
    More actions

    I guess this would fix it:

                with self.subTest(timeout):
    
    -               future = self.executor.submit(time.sleep, 0.1)
    +               future = self.executor.submit(time.sleep, 10.0)
                    completed_futures = set()
                    try:

    I don't think the short sleep serves any testing purpose here, it just makes the test more likely to fail if there is any unexpected CPU contention.

    Reacted by Chris Withers
  4. vstinner commented on Sep 27, 2023

    @vstinner
    vstinner
    on Sep 27, 2023
    MemberAuthor
    More actions

    The problem is that the test waits cleanly until the future completes, and so the test takes 10 seconds with your change, instead of 100 ms (100x slower).

    Reacted by JosephSBoyle
  5. vstinner
    added 2 commits that reference this issue on Sep 27, 2023

    pythongh-109565: Fix concurrent.futures test_future_times_out()

    bf4ab70

    pythongh-109565: Fix concurrent.futures test_future_times_out()

    afcaa29
  6. vstinner commented on Sep 27, 2023

    @vstinner
    vstinner
    on Sep 27, 2023
    MemberAuthor
    More actions

    I proposed PR #109949 to fix this test.

  7. vstinner
    added a commit that references this issue on Sep 27, 2023

    gh-109565: Fix concurrent.futures test_future_times_out() (#109949)

    b1aebf1
  8. miss-islington
    added a commit that references this issue on Sep 27, 2023

    pythongh-109565: Fix concurrent.futures test_future_times_out() (pyth…

    62986cb
  9. csm10495
    added a commit that references this issue on Sep 28, 2023

    pythongh-109565: Fix concurrent.futures test_future_times_out() (pyth…

    cb42e83
  10. Yhg1s
    added a commit that references this issue on Oct 2, 2023

    [3.12] gh-109565: Fix concurrent.futures test_future_times_out() (GH-…

    73ec1e7
  11. vstinner
    closed this as completedon Oct 17, 2023
  12. Glyphack
    added a commit that references this issue on Sep 2, 2024

    pythongh-109565: Fix concurrent.futures test_future_times_out() (pyth…

    4bb49f3
  13. colesbury commented on Mar 1, 2025

    @colesbury
    colesbury
    on Mar 1, 2025
    Contributor
    More actions

    Seen again in https://github.com/python/cpython/actions/runs/13606703595/job/38039027766?pr=130731:

    FAIL: test_future_times_out (test.test_concurrent_futures.test_as_completed.ThreadPoolAsCompletedTest.test_future_times_out) [0.1]
    Test ``futures.as_completed`` timing out before
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "D:\a\cpython\cpython\Lib\test\test_concurrent_futures\test_as_completed.py", line 63, in test_future_times_out
        self.assertEqual(completed_futures, already_completed)
        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: Items in the first set but not the second:
    <Future at 0x200006535e0 state=finished returned NoneType>
    ----------------------------------------------------------------------
    
  14. colesbury
    reopened this on Mar 1, 2025
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 dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.