diff options
author | W. J. van der Laan <laanwj@protonmail.com> | 2021-09-16 16:00:23 +0200 |
---|---|---|
committer | W. J. van der Laan <laanwj@protonmail.com> | 2021-09-16 16:00:41 +0200 |
commit | 6d76b57ca0cdf6f9c19ce065b9a4a628930a78b5 (patch) | |
tree | 763e983b62dbba54b0dc3ef0a5fcb6acccaf752a /test | |
parent | 7a999879d2f6961579fb1057566cbb76232c644f (diff) | |
parent | fad4f4464583e3c26c95c2c301f39df6b3dcf6c7 (diff) | |
download | bitcoin-6d76b57ca0cdf6f9c19ce065b9a4a628930a78b5.tar.xz |
Merge bitcoin/bitcoin#22960: test: Set peertimeout in write_config
fad4f4464583e3c26c95c2c301f39df6b3dcf6c7 test: Set peertimeout in write_config (MarcoFalke)
Pull request description:
This avoids having to remember to set it whenever mocktime is used with
peer connections. Also, it might help avoiding disconnects when
attaching a debugger to a running test.
ACKs for top commit:
laanwj:
Concept and code review ACK fad4f4464583e3c26c95c2c301f39df6b3dcf6c7
Tree-SHA512: 00c742571c0524c1b3f55e0217433ef7aa2dccccc12650caab98b4cf9231669f37fc589c7475f28d5725ffe2436c76205920eaece4a47fd27dc8872421a48e5c
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/feature_bip68_sequence.py | 5 | ||||
-rwxr-xr-x | test/functional/feature_csv_activation.py | 1 | ||||
-rwxr-xr-x | test/functional/feature_maxuploadtarget.py | 1 | ||||
-rw-r--r-- | test/functional/test_framework/util.py | 5 |
4 files changed, 6 insertions, 6 deletions
diff --git a/test/functional/feature_bip68_sequence.py b/test/functional/feature_bip68_sequence.py index 85522164d2..09cda8444a 100755 --- a/test/functional/feature_bip68_sequence.py +++ b/test/functional/feature_bip68_sequence.py @@ -41,10 +41,7 @@ class BIP68Test(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 2 self.extra_args = [ - [ - "-acceptnonstdtxn=1", - "-peertimeout=9999", # bump because mocktime might cause a disconnect otherwise - ], + ["-acceptnonstdtxn=1"], ["-acceptnonstdtxn=0"], ] diff --git a/test/functional/feature_csv_activation.py b/test/functional/feature_csv_activation.py index 2bfe22267b..d2b3fe45d1 100755 --- a/test/functional/feature_csv_activation.py +++ b/test/functional/feature_csv_activation.py @@ -94,7 +94,6 @@ class BIP68_112_113Test(BitcoinTestFramework): self.num_nodes = 1 self.setup_clean_chain = True self.extra_args = [[ - '-peertimeout=999999', # bump because mocktime might cause a disconnect otherwise '-whitelist=noban@127.0.0.1', '-par=1', # Use only one script thread to get the exact reject reason for testing ]] diff --git a/test/functional/feature_maxuploadtarget.py b/test/functional/feature_maxuploadtarget.py index 12bcc2ffc5..ac4d40638e 100755 --- a/test/functional/feature_maxuploadtarget.py +++ b/test/functional/feature_maxuploadtarget.py @@ -38,7 +38,6 @@ class MaxUploadTest(BitcoinTestFramework): self.extra_args = [[ "-maxuploadtarget=800", "-acceptnonstdtxn=1", - "-peertimeout=9999", # bump because mocktime might cause a disconnect otherwise ]] self.supports_cli = False diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index ec27fd7f85..d66499dbcb 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -364,6 +364,11 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect= f.write("dnsseed=0\n") f.write("fixedseeds=0\n") f.write("listenonion=0\n") + # Increase peertimeout to avoid disconnects while using mocktime. + # peertimeout is measured in wall clock time, so setting it to the + # duration of the longest test is sufficient. It can be overriden in + # tests. + f.write("peertimeout=999999\n") f.write("printtoconsole=0\n") f.write("upnp=0\n") f.write("natpmp=0\n") |