Early detect non-loopback traffic from unit tests #33363

issue vasild openend this issue on September 11, 2025
  1. vasild commented at 9:33 am on September 11, 2025: contributor

    Tests should not attempt to create network connections over the internet because that has unpredictable timing and outcome. It could also reveal the location (IP address) where somebody is running Bitcoin Core tests, if the target address is very specific, e.g. not github.com:443, but 1.2.3.4:8333 for example. See #31339.

    #31349 is an attempt to detect such cases in CI. In the discussions on that PR a complementary idea came up - to use a mocked socket from unit tests to detect such usage. That could be done in addition if there is support for it and if not too complicated.

    I guess, if this is to be done, either CreateSock() should be changed from BasicTestingSetup to throw right away or return a mocked Sock object that has a real underlying socket and throws on attempts to create non-loopback connections.


vasild


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-09-26 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me