bitcoin: ci: ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

Usually they come with a follow-up error of Unable to connect to bitcoind after 2400s (or similar).

This is a tracking issue, because all tests are affected.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 24 (24 by maintainers)

Commits related to this issue

Most upvoted comments

Also #28509.

Thanks for the added context @hebasto! ~There seems to be some agreement that upgrading to Python 3.12 would fix the issue. However, I was unable to find a documented fix, do you have a link? Your comment links to an issue with subprocess.run but it’s a higher-level function implemented on top of subprocess.Popen which we use.~

Maybe GHA has some kind of “Anti-Virus” software that may block some processes?

Little experience with GHA, but yeah, those kind of things slowing down CI is not unheard of.

Probably unrelated to this issue at this point, but the test_runner provides the --portseed, so no PID is used.

Thanks for pointing that out!

test = self.test_list.pop(0)
portseed = len(self.test_list)
portseed_arg = ["--portseed={}".format(portseed)]

…that should indeed circumvent possible port-reuse issues stemming from OS PID reuse choices.

Given…

def p2p_port(n):
    return PORT_MIN + n + (MAX_NODES * PortSeed.n) % (PORT_RANGE - 1 - MAX_NODES)
    # Constants: 11000 + n + (12 * PortSeed.n) % (5000 - 1 - 12)
    #          = 11000 + n + (12 * PortSeed.n) % (4987)

…we should be able to have 415 tests (4987 / 12) before tests at the beginning of the test_list risk colliding ports with tests at the end. From what I can see in test/functional/test_runner.py we have ~300 tests. 👍

Regarding process start issues, would there be any support for me attempting to integrate Microsoft SysInternals ProcDump into CI & test framework to be able to call procdump -mm <PID> on the bitcoind.exe process and hopefully figure out where the process is stalling?

There seems to some agreement that upgrading to Python 3.12 would fix the issue. However, I was unable to find a documented fix, do you have a link?

This was just a wrong comment by myself. See https://github.com/bitcoin/bitcoin/pull/28509#issuecomment-1727885738

For reference: You can use git log -S "unique_code_blob" to see when (and hopefully why) a piece of code was added. In this case it would be something like:

$ git log -S ' != -342' 
commit 62c304ea481d474bc87d950e21907b8b05134fe7
Date:   Sat Oct 6 13:42:11 2018 +0800

    tests: Allow closed http server in assert_start_raises_init_error