-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[tests] make pruning.py faster #10591
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
Conversation
2463007 to
9e894d2
Compare
|
Concept ACK. Needs rebase |
|
I'll rebase if/when #10556 is merged, since I expect that may require further feedback and iteration. There's no rush for this PR since pruning.py isn't run by many people. Currently just looking for feedback on the concept and whether this helps reduce runtime for other people. |
|
Since this runs a lot faster, can we also enable it for the travis cron job? |
I don't think so. See the original description:
If you can think of a cunning way to get this to run on Travis, that'd be great. I haven't been able to come up with anything. |
|
Needs rebase |
TestNode is a class responsible for all state related to a bitcoind node under test. It stores local state, is responsible for tracking the bitcoind process and delegates unrecognised messages to the RPC connection. This commit changes start_nodes and stop_nodes to start and stop the bitcoind nodes in parallel, making test setup and teardown much faster.
This commit makes the pruning.py much faster. Key insights to do this: - pruning.py doesn't care what kind of transactions make up the big blocks that are pruned in the test. Instead of making blocks with several large, expensive to construct and validate transactions, instead make the large blocks contain a single coinbase transaction with a huge OP_RETURN txout. - avoid stop-starting nodes where possible. This test could probably be made even faster by using the P2P interface for submitting blocks instead of the submitblock RPC.
|
rebased |
|
Does this depend on the TestNode commit? |
|
Testing this: |
|
@jnewbery Needs rebase |
|
closing this for now. It seems to work most of the time for me, but intermittently fails for the same reason that @fanquake gives above. There's refactoring work going on in the test_framework right now, so this is likely to require more rebases and it doesn't seem worth the effort given that very few people run this test. |
|
Fwiw, perhaps more people would run this test if it was faster. Personally I avoid it precisely because of how slow it is. |
|
Can remove the up for grabs label with #15686 making this obsolete. |
|
Thanks @adamjonas |
Headline: Brings time for pruning.py down to ~4 minutes on my VM when run without other tests in parallel.
A couple of modifications to make pruning.py much faster:
Builds on top of #10555 and #10556
My VM has slow disk i/o. This would possibly be faster with faster disk i/o. Unfortunately, pruning.py still isn't able to run on Travis. It appears that disk access is very slow for in the Travis environment, and this test still times out/fails. Unfortunately, it's not possible to run this test without very heavy disk access - the whole point of pruning is to remove block files when disk usage goes over a certain threshold.
I'd be interested to know how this affects runtime for others.
@sdaftuar