Skip to content

Commit 02c7fd8

Browse files
committed
Merge bitcoin/bitcoin#29483: test, ci: add --v1transport option, add --v2transport to a CI task
ecc036c ci: add --v2transport to an existing CI job (Martin Zumsande) 3a25a57 test: ignore --v2transport for older versions instead of asserting (Martin Zumsande) 547aacf test: add -v1transport option and use it in test_runner (Martin Zumsande) Pull request description: This suggests a strategy to run the functional tests with both v1 and v2 transport in the CI. **Status Quo:** There is both the global `--v2transport` option for the `test_runner.py` (not enabled by default), plus the possibility to specify `--v2transport` for particular tests, which is used for a handful of tests. Currently, when running `test_runner.py --v2transport`, these tests are run twice with the same `--v2transport` configuration, as has been noted in bitcoin/bitcoin#29358 (comment), which is wasteful. **Suggested Change:** Fix this by adding a `--v1transport` option and using it in `test_runner.py`, so that irrespective of the global `--v2transport` flag, the tests that run twice use v1 in one run and v2 in the other. Also add `--v2transport` to one CI task (`multiprocess, i686, DEBUG`). This means, that for each CI task, the majority of functional tests will run once using the global `--v2transport` option if provided, while a few selected tests will always run two times, once with `v1` and once with `v2`. **Rationale:** A simpler alternative would have been to remove all test-specific `--v2transport` commands from `test_runner.py` and just enable `--v2transport` option for a few CI tasks. I didn't do that because it would have meant that v2 would never be running in the CI for some platforms, and also be run a lot less locally by users and devs (who would have to actively enable the `--v2transport` option). ACKs for top commit: tdb3: ACK for ecc036c. achow101: ACK ecc036c stratospher: ACK ecc036c. vasild: ACK ecc036c Tree-SHA512: 375b2293d49991f2fbd8e1bb646c0034004a09cee36063bc32996b721323eb19a43d7b2f36b3f9a3fdca846d74f48d8f1387565c03ef5d34b3481d2a0fe1d328
2 parents b4a0575 + ecc036c commit 02c7fd8

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

ci/test/00_setup_env_i686_multiprocess.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export CI_IMAGE_NAME_TAG="docker.io/amd64/ubuntu:22.04"
1212
export PACKAGES="llvm clang g++-multilib"
1313
export DEP_OPTS="DEBUG=1 MULTIPROCESS=1"
1414
export GOAL="install"
15+
export TEST_RUNNER_EXTRA="--v2transport"
1516
export BITCOIN_CONFIG="--enable-debug CC='clang -m32' CXX='clang++ -m32' \
1617
CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE'"
1718
export BITCOIND=bitcoin-node # Used in functional tests

test/functional/test_framework/test_framework.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ def parse_args(self):
191191
parser.add_argument("--timeout-factor", dest="timeout_factor", type=float, help="adjust test timeouts by a factor. Setting it to 0 disables all timeouts")
192192
parser.add_argument("--v2transport", dest="v2transport", default=False, action="store_true",
193193
help="use BIP324 v2 connections between all nodes by default")
194+
parser.add_argument("--v1transport", dest="v1transport", default=False, action="store_true",
195+
help="Explicitly use v1 transport (can be used to overwrite global --v2transport option)")
194196

195197
self.add_options(parser)
196198
# Running TestShell in a Jupyter notebook causes an additional -f argument
@@ -206,6 +208,8 @@ def parse_args(self):
206208
config = configparser.ConfigParser()
207209
config.read_file(open(self.options.configfile))
208210
self.config = config
211+
if self.options.v1transport:
212+
self.options.v2transport=False
209213

210214
if "descriptors" not in self.options:
211215
# Wallet is not required by the test at all and the value of self.options.descriptors won't matter.

test/functional/test_framework/test_node.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ def __init__(self, i, datadir_path, *, chain, rpchost, timewait, timeout_factor,
136136
self.args.append("-v2transport=1")
137137
else:
138138
self.args.append("-v2transport=0")
139-
else:
140-
# v2transport requested but not supported for node
141-
assert not v2transport
139+
# if v2transport is requested via global flag but not supported for node version, ignore it
142140

143141
self.cli = TestNodeCLI(bitcoin_cli, self.datadir_path)
144142
self.use_cli = use_cli

test/functional/test_runner.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
'wallet_backup.py --legacy-wallet',
121121
'wallet_backup.py --descriptors',
122122
'feature_segwit.py --legacy-wallet',
123-
'feature_segwit.py --descriptors',
123+
'feature_segwit.py --descriptors --v1transport',
124124
'feature_segwit.py --descriptors --v2transport',
125125
'p2p_tx_download.py',
126126
'wallet_avoidreuse.py --legacy-wallet',
@@ -156,7 +156,7 @@
156156
# vv Tests less than 30s vv
157157
'p2p_invalid_messages.py',
158158
'rpc_createmultisig.py',
159-
'p2p_timeouts.py',
159+
'p2p_timeouts.py --v1transport',
160160
'p2p_timeouts.py --v2transport',
161161
'wallet_dump.py --legacy-wallet',
162162
'rpc_signer.py',
@@ -201,7 +201,7 @@
201201
'mempool_spend_coinbase.py',
202202
'wallet_avoid_mixing_output_types.py --descriptors',
203203
'mempool_reorg.py',
204-
'p2p_block_sync.py',
204+
'p2p_block_sync.py --v1transport',
205205
'p2p_block_sync.py --v2transport',
206206
'wallet_createwallet.py --legacy-wallet',
207207
'wallet_createwallet.py --usecli',
@@ -230,13 +230,13 @@
230230
'wallet_transactiontime_rescan.py --descriptors',
231231
'wallet_transactiontime_rescan.py --legacy-wallet',
232232
'p2p_addrv2_relay.py',
233-
'p2p_compactblocks_hb.py',
233+
'p2p_compactblocks_hb.py --v1transport',
234234
'p2p_compactblocks_hb.py --v2transport',
235-
'p2p_disconnect_ban.py',
235+
'p2p_disconnect_ban.py --v1transport',
236236
'p2p_disconnect_ban.py --v2transport',
237237
'feature_posix_fs_permissions.py',
238238
'rpc_decodescript.py',
239-
'rpc_blockchain.py',
239+
'rpc_blockchain.py --v1transport',
240240
'rpc_blockchain.py --v2transport',
241241
'rpc_deprecated.py',
242242
'wallet_disable.py',
@@ -246,21 +246,21 @@
246246
'p2p_getaddr_caching.py',
247247
'p2p_getdata.py',
248248
'p2p_addrfetch.py',
249-
'rpc_net.py',
249+
'rpc_net.py --v1transport',
250250
'rpc_net.py --v2transport',
251251
'wallet_keypool.py --legacy-wallet',
252252
'wallet_keypool.py --descriptors',
253253
'wallet_descriptor.py --descriptors',
254254
'p2p_nobloomfilter_messages.py',
255255
'p2p_filter.py',
256-
'rpc_setban.py',
256+
'rpc_setban.py --v1transport',
257257
'rpc_setban.py --v2transport',
258258
'p2p_blocksonly.py',
259259
'mining_prioritisetransaction.py',
260260
'p2p_invalid_locator.py',
261-
'p2p_invalid_block.py',
261+
'p2p_invalid_block.py --v1transport',
262262
'p2p_invalid_block.py --v2transport',
263-
'p2p_invalid_tx.py',
263+
'p2p_invalid_tx.py --v1transport',
264264
'p2p_invalid_tx.py --v2transport',
265265
'p2p_v2_transport.py',
266266
'p2p_v2_encrypted.py',
@@ -286,12 +286,12 @@
286286
'rpc_preciousblock.py',
287287
'wallet_importprunedfunds.py --legacy-wallet',
288288
'wallet_importprunedfunds.py --descriptors',
289-
'p2p_leak_tx.py',
289+
'p2p_leak_tx.py --v1transport',
290290
'p2p_leak_tx.py --v2transport',
291291
'p2p_eviction.py',
292-
'p2p_ibd_stalling.py',
292+
'p2p_ibd_stalling.py --v1transport',
293293
'p2p_ibd_stalling.py --v2transport',
294-
'p2p_net_deadlock.py',
294+
'p2p_net_deadlock.py --v1transport',
295295
'p2p_net_deadlock.py --v2transport',
296296
'wallet_signmessagewithaddress.py',
297297
'rpc_signmessagewithprivkey.py',
@@ -381,7 +381,7 @@
381381
'feature_coinstatsindex.py',
382382
'wallet_orphanedreward.py',
383383
'wallet_timelock.py',
384-
'p2p_node_network_limited.py',
384+
'p2p_node_network_limited.py --v1transport',
385385
'p2p_node_network_limited.py --v2transport',
386386
'p2p_permissions.py',
387387
'feature_blocksdir.py',

0 commit comments

Comments
 (0)