mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-11 23:30:05 +02:00
test: avoid non-loopback network traffic from node_init_tests/init_test
The test calls: `AppInitMain()` -> `StartMapPort()` -> `StartThreadMapPort()` -> `ThreadMapPort()` -> `ProcessPCP()` -> `PCPRequestPortMap()` -> `CreateSock()` and on the returned value from `CreateSock()` it calls the `Connect()` method. Thus, change `BasicTestingSetup::BasicTestingSetup()` to set `-natpmp` to 0. This way `node_init_tests/init_test` or other tests will not do network activity due to `ThreadMapPort()`. Also add a comment about `natpmp=0` in `test/functional/test_framework/util.py`. Also set `-dnsseed=0` in `BasicTestingSetup::BasicTestingSetup()` to avoid DNS queries.
This commit is contained in:
@@ -576,7 +576,7 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect=
|
||||
# in tests.
|
||||
f.write("peertimeout=999999999\n")
|
||||
f.write("printtoconsole=0\n")
|
||||
f.write("natpmp=0\n")
|
||||
f.write("natpmp=0\n") # Avoid non-loopback network traffic during tests.
|
||||
f.write("shrinkdebugfile=0\n")
|
||||
# To improve SQLite wallet performance so that the tests don't timeout, use -unsafesqlitesync
|
||||
f.write("unsafesqlitesync=1\n")
|
||||
|
||||
Reference in New Issue
Block a user