New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: speed up wallet_avoidreuse, add logging #17362
test: speed up wallet_avoidreuse, add logging #17362
Conversation
Test output with logging:
|
5ea05c9
to
d2edf02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jonatack!
tACK d2edf02
Reviewed test, also don't see any need for tx propagation delay.
My informal run times confirm improvement.
Before 463eab5 : 31.9 / 22.9 / 35.7 / 29.8 / 34.8 / 29.7 /
With patch d2edf02: 14.7 / 11.9 / 10.7/ 12.9 / 13.7 / 13.7 /12.4
However, I am unsure of the source of variability. I don't see an improvement there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK d2edf02 on macOS 10.15 with --enable-debug
(which is slower, but better at catching issues).
Before: 18-25 seconds
After: 10 seconds
Part of inconsistency can come from caching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some general notes. I don't see a reason to do most of these changes. Most look like irrelevant character shuffling, which neither the python interpreter should care about nor any human reader of the code.
No need to change them and invalidate the ACK, but something to keep in mind for the future.
@MarcoFalke, thank you for reviewing. I empathise with your remarks and understand the increased review burden and issues of churn/git blame/git history. Will minimise the changeset in the future. |
d2edf02
to
2b04c7c
Compare
Use -whitelist to speed up transaction relay. The wallet_avoidreuse.py test is not intended to test transaction relay/timing, so it should be fine to do this here. This greatly reduces test run time variability and speeds up the test by 2-3 times on average, e.g. on my system from 20-30 seconds down to 8-10 seconds.
2b04c7c
to
0e7c90e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased to minimal changeset, no code changes except the following:
-self.extra_args = [["-whitelist=127.0.0.1"]] * 2
+self.extra_args = [["-whitelist=127.0.0.1"]] * self.num_nodes
Thanks. This patch is a lot more candy to my eyes than the previous one. |
ACK 0e7c90e 🐊 Show signature and timestampSignature:
Timestamp of file with hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 0e7c90e
master (772673d):
time test/functional/test_runner.py wallet_avoidreuse.py
wallet_avoidreuse.py | ✓ Passed | 38 s
wallet_avoidreuse.py | ✓ Passed | 14 s
wallet_avoidreuse.py | ✓ Passed | 27 s
wallet_avoidreuse.py | ✓ Passed | 22 s
This PR (0e7c90e):
time test/functional/test_runner.py wallet_avoidreuse.py
wallet_avoidreuse.py | ✓ Passed | 6 s
wallet_avoidreuse.py | ✓ Passed | 6 s
wallet_avoidreuse.py | ✓ Passed | 6 s
wallet_avoidreuse.py | ✓ Passed | 6 s
I agree -- sorry about that brainfart. |
0e7c90e test: speed up wallet_avoidreuse.py (Jon Atack) 6d50b26 test: add logging to wallet_avoidreuse.py (Jon Atack) Pull request description: Inspired by PRs #17340 and #15881. - add logging - pass -whitelist in `set_test_params` to speed up transaction relay `wallet_avoidreuse.py` is not intended to test P2P transaction relay/timing, so it should be fine to do this here. This reduces test run time variability and speeds up the test by 2-3 times on average. Test run times in seconds: - before: 20, 24, 22, 17, 27, 40, 30 - after: 10, 10, 8, 9, 10, 7, 8 ACKs for top commit: MarcoFalke: ACK 0e7c90e 🐊 fanquake: ACK 0e7c90e Tree-SHA512: 6d954a0aaf402c9594201626b59d29263479059e68fa5155bb44ed973cd0c3347729dd78b78b4d5a2275e45da365dc1afb4cc7e3293dea33fcc2e3e83a39faf5
Summary: 0e7c90eb37a687158c261ddd1ff9f1028a1e7012 test: speed up wallet_avoidreuse.py (Jon Atack) 6d50b2606ea9249627556051637080c3587b1b04 test: add logging to wallet_avoidreuse.py (Jon Atack) Pull request description: Inspired by PRs #17340 and #15881. - add logging - pass -whitelist in `set_test_params` to speed up transaction relay `wallet_avoidreuse.py` is not intended to test P2P transaction relay/timing, so it should be fine to do this here. This reduces test run time variability and speeds up the test by 2-3 times on average. Test run times in seconds: - before: 20, 24, 22, 17, 27, 40, 30 - after: 10, 10, 8, 9, 10, 7, 8 --- Backport of Core [[bitcoin/bitcoin#17362 | PR17362]] Test Plan: test_runner.py wallet_avoidreuse Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6588
… speedup) 9e78943 test: speedup p2p_feefilter.py by whitelisting peers (immediate tx relay) (Sebastian Falbesoner) fe3f0cc test: use wait_until for invs matching in p2p_feefilter.py (Sebastian Falbesoner) 6d94192 test: add logging for p2p_feefilter.py (Sebastian Falbesoner) Pull request description: This PR gives some love to the functional test `p2p_feefilter.py` by introducing the following changes: * add missing log messages for the `test_feefilter` subtest (the main one) * deduplicate code by using the utility function `wait_until` (already using the [recently introduced version](12410b1)) instead of a manual condition checking loop with `time.sleep` * improve naming of the function `matchAllInvs` (more expressive name, snake_case) and moving it from global namespace to the connection class `FeefilterConn` * speeding up the test significantly by the good ol' method of activating immediate tx relay (as seen on e.g. #17121, #17124, #17340, #17362, ...): ``` master branch: $ time ./p2p_feefilter.py ... real 0m39.367s user 0m1.227s sys 0m0.571s PR branch: $ time ./p2p_feefilter.py ... real 0m9.386s user 0m1.120s sys 0m0.577s ``` ACKs for top commit: instagibbs: code review ACK 9e78943 jonatack: re-ACK 9e78943 per `git range-diff 3ab2582 ea74a3c 9e78943` Tree-SHA512: fe21c1c5413df9165fea916b5d5f609d3ba33e7b5c3364b38eb824fcc55d9e6abddf27116cbc0b325913d451a73c44542040fb916aec9c46f805c6e12f6f10cf
…toring, speedup) 9e78943 test: speedup p2p_feefilter.py by whitelisting peers (immediate tx relay) (Sebastian Falbesoner) fe3f0cc test: use wait_until for invs matching in p2p_feefilter.py (Sebastian Falbesoner) 6d94192 test: add logging for p2p_feefilter.py (Sebastian Falbesoner) Pull request description: This PR gives some love to the functional test `p2p_feefilter.py` by introducing the following changes: * add missing log messages for the `test_feefilter` subtest (the main one) * deduplicate code by using the utility function `wait_until` (already using the [recently introduced version](bitcoin@12410b1)) instead of a manual condition checking loop with `time.sleep` * improve naming of the function `matchAllInvs` (more expressive name, snake_case) and moving it from global namespace to the connection class `FeefilterConn` * speeding up the test significantly by the good ol' method of activating immediate tx relay (as seen on e.g. bitcoin#17121, bitcoin#17124, bitcoin#17340, bitcoin#17362, ...): ``` master branch: $ time ./p2p_feefilter.py ... real 0m39.367s user 0m1.227s sys 0m0.571s PR branch: $ time ./p2p_feefilter.py ... real 0m9.386s user 0m1.120s sys 0m0.577s ``` ACKs for top commit: instagibbs: code review ACK bitcoin@9e78943 jonatack: re-ACK 9e78943 per `git range-diff 3ab2582 ea74a3c 9e78943` Tree-SHA512: fe21c1c5413df9165fea916b5d5f609d3ba33e7b5c3364b38eb824fcc55d9e6abddf27116cbc0b325913d451a73c44542040fb916aec9c46f805c6e12f6f10cf
Inspired by PRs #17340 and #15881.
set_test_params
to speed up transaction relaywallet_avoidreuse.py
is not intended to test P2P transaction relay/timing, so it should be fine to do this here. This reduces test run time variability and speeds up the test by 2-3 times on average.Test run times in seconds:
before: 20, 24, 22, 17, 27, 40, 30
after: 10, 10, 8, 9, 10, 7, 8