Skip to content

Unreliable imap test in test_multiprocessing with fixed sleep duration #158975

Description

@nascheme

Bug report

I'm getting a failure in CI (on Windows) that produces the log output below. I believe it's due to the test case being unreliable since it uses fixed sleep durations, i.e. time.sleep(0.2). The test would be more reliable if it used bounded waits.

FAIL: test_imap_and_imap_unordered_with_buffersize_when_buffer_is_full (test.test_multiprocessing_spawn.test_threads.WithThreadsTestPool.test_imap_and_imap_unordered_with_buffersize_when_buffer_is_full) (method_name='imap')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\support\__init__.py", line 1121, in wrapper
    func(self, *args, **kwargs, **subtest_kwargs)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\a\cpython\cpython\Lib\test\_test_multiprocessing.py", line 3227, in test_imap_and_imap_unordered_with_buffersize_when_buffer_is_full
    self.assertEqual(last_produced_task_arg.value, processes + 2)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 5 != 6

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions