Skip to content

Commit fa27cf4

Browse files
committed
test: Default timeout factor to 4 under --valgrind
1 parent d4ebdce commit fa27cf4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/functional/test_framework/test_framework.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ def __init__(self):
120120
self.disable_autoconnect = True
121121
self.set_test_params()
122122
assert self.wallet_names is None or len(self.wallet_names) <= self.num_nodes
123-
if self.options.timeout_factor == 0 :
124-
self.options.timeout_factor = 99999
125123
self.rpc_timeout = int(self.rpc_timeout * self.options.timeout_factor) # optionally, increase timeout by a factor
126124

127125
def main(self):
@@ -193,14 +191,17 @@ def parse_args(self):
193191
help="run nodes under the valgrind memory error detector: expect at least a ~10x slowdown. valgrind 3.14 or later required. Forces --nosandbox.")
194192
parser.add_argument("--randomseed", type=int,
195193
help="set a random seed for deterministically reproducing a previous test run")
196-
parser.add_argument('--timeout-factor', dest="timeout_factor", type=float, default=1.0, help='adjust test timeouts by a factor. Setting it to 0 disables all timeouts')
194+
parser.add_argument("--timeout-factor", dest="timeout_factor", type=float, help="adjust test timeouts by a factor. Setting it to 0 disables all timeouts")
197195

198196
self.add_options(parser)
199197
# Running TestShell in a Jupyter notebook causes an additional -f argument
200198
# To keep TestShell from failing with an "unrecognized argument" error, we add a dummy "-f" argument
201199
# source: https://stackoverflow.com/questions/48796169/how-to-fix-ipykernel-launcher-py-error-unrecognized-arguments-in-jupyter/56349168#56349168
202200
parser.add_argument("-f", "--fff", help="a dummy argument to fool ipython", default="1")
203201
self.options = parser.parse_args()
202+
if self.options.timeout_factor == 0:
203+
self.options.timeout_factor = 99999
204+
self.options.timeout_factor = self.options.timeout_factor or (4 if self.options.valgrind else 1)
204205
self.options.previous_releases_path = previous_releases_path
205206

206207
config = configparser.ConfigParser()

0 commit comments

Comments
 (0)