Skip to content

intermittent issue on Windows when starting the Python network thread. stderr: Exception in thread NetworkThread: OSError: [WinError 10022] An invalid argument was supplied #35112

Closed

Description

@maflcko

https://github.com/bitcoin/bitcoin/actions/runs/24551395055/job/71778200514?pr=35090#step:10:277:

458/458 - p2p_1p1c_network.py failed, Duration: 2400 s

stdout:
2026-04-17T06:50:16.866132Z TestFramework (INFO): PRNG seed is: 3716932496403917697

2026-04-17T07:30:16.888691Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''

        self.wait_until(lambda: self.network_thread.network_event_loop is not None and self.network_thread.network_event_loop.is_running())

'''

2026-04-17T07:30:16.889094Z TestFramework (ERROR): Unexpected exception:

Traceback (most recent call last):

  File "D:\a\bitcoin\bitcoin\test\functional\test_framework\test_framework.py", line 139, in main

    self.setup()

    ~~~~~~~~~~^^

  File "D:\a\bitcoin\bitcoin\test\functional\test_framework\test_framework.py", line 264, in setup

    self.wait_until(lambda: self.network_thread.network_event_loop is not None and self.network_thread.network_event_loop.is_running())

    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\a\bitcoin\bitcoin\test\functional\test_framework\test_framework.py", line 737, in wait_until

    return wait_until_helper_internal(test_function, timeout=timeout, timeout_factor=self.options.timeout_factor, check_interval=check_interval)

  File "D:\a\bitcoin\bitcoin\test\functional\test_framework\util.py", line 439, in wait_until_helper_internal

    raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))

AssertionError: Predicate ''''

        self.wait_until(lambda: self.network_thread.network_event_loop is not None and self.network_thread.network_event_loop.is_running())

''' not true after 2400.0 seconds

2026-04-17T07:30:16.894010Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.

2026-04-17T07:30:16.894106Z TestFramework (WARNING): Not cleaning up dir D:\a\bitcoin\bitcoin\test_runner_₿_🏃_20260417_064118\p2p_1p1c_network_197

2026-04-17T07:30:16.894201Z TestFramework (ERROR): Test failed. Test logging available at D:\a\bitcoin\bitcoin\test_runner_₿_🏃_20260417_064118\p2p_1p1c_network_197/test_framework.log

2026-04-17T07:30:16.894460Z TestFramework (ERROR): 

2026-04-17T07:30:16.894758Z TestFramework (ERROR): Hint: Call D:\a\bitcoin\bitcoin\test\functional\combine_logs.py 'D:\a\bitcoin\bitcoin\test_runner_₿_🏃_20260417_064118\p2p_1p1c_network_197' to consolidate all logs

2026-04-17T07:30:16.894848Z TestFramework (ERROR): 

2026-04-17T07:30:16.894904Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.

2026-04-17T07:30:16.894988Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues

2026-04-17T07:30:16.895038Z TestFramework (ERROR): 



stderr:
Exception in thread NetworkThread:

Traceback (most recent call last):

  File "C:\hostedtoolcache\windows\Python\3.14.3\x64\Lib\threading.py", line 1082, in _bootstrap_inner

    self._context.run(self.run)

    ~~~~~~~~~~~~~~~~~^^^^^^^^^^

  File "D:\a\bitcoin\bitcoin\test\functional\test_framework\p2p.py", line 747, in run

    self.network_event_loop.run_forever()

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^

  File "C:\hostedtoolcache\windows\Python\3.14.3\x64\Lib\asyncio\base_events.py", line 677, in run_forever

    self._run_once()

    ~~~~~~~~~~~~~~^^

  File "C:\hostedtoolcache\windows\Python\3.14.3\x64\Lib\asyncio\base_events.py", line 2008, in _run_once

    event_list = self._selector.select(timeout)

  File "C:\hostedtoolcache\windows\Python\3.14.3\x64\Lib\selectors.py", line 314, in select

    r, w, _ = self._select(self._readers, self._writers, [], timeout)

              ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\hostedtoolcache\windows\Python\3.14.3\x64\Lib\selectors.py", line 305, in _select

    r, w, x = select.select(r, w, w, timeout)

              ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^

OSError: [WinError 10022] An invalid argument was supplied



Combine the logs and print the last 99999999 lines ...

============
Combined log for D:\a\bitcoin\bitcoin/test_runner_₿_🏃_20260417_064118/p2p_1p1c_network_197:
============

 test  2026-04-17T06:50:16.866132Z TestFramework (INFO): PRNG seed is: 3716932496403917697 
 test  2026-04-17T06:50:16.866387Z TestFramework (DEBUG): Setting up network thread 
 test  2026-04-17T07:30:16.888691Z TestFramework.utils (ERROR): wait_until() failed. Predicate: '''' 
                                           self.wait_until(lambda: self.network_thread.network_event_loop is not None and self.network_thread.network_event_loop.is_running())
                                   '''
 test  2026-04-17T07:30:16.889094Z TestFramework (ERROR): Unexpected exception: 
                                   Traceback (most recent call last):
                                     File "D:\a\bitcoin\bitcoin\test\functional\test_framework\test_framework.py", line 139, in main
                                       self.setup()
                                       ~~~~~~~~~~^^
                                     File "D:\a\bitcoin\bitcoin\test\functional\test_framework\test_framework.py", line 264, in setup
                                       self.wait_until(lambda: self.network_thread.network_event_loop is not None and self.network_thread.network_event_loop.is_running())
                                       ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                     File "D:\a\bitcoin\bitcoin\test\functional\test_framework\test_framework.py", line 737, in wait_until
                                       return wait_until_helper_internal(test_function, timeout=timeout, timeout_factor=self.options.timeout_factor, check_interval=check_interval)
                                     File "D:\a\bitcoin\bitcoin\test\functional\test_framework\util.py", line 439, in wait_until_helper_internal
                                       raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
                                   AssertionError: Predicate ''''
                                           self.wait_until(lambda: self.network_thread.network_event_loop is not None and self.network_thread.network_event_loop.is_running())
                                   ''' not true after 2400.0 seconds
 test  2026-04-17T07:30:16.893463Z TestFramework (DEBUG): Closing down network thread 

Activity

  1. maflcko commented on Apr 19, 2026

    @maflcko
    MemberAuthor

    Ref #34367

  2. maflcko commented on Jun 26, 2026

    @maflcko
    MemberAuthor

    Is this still an issue that happens? Maybe it can be closed for now and re-opened when it happens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions