A new -test=pause_load_mempool startup argument that lets the test framework pause node initialization right before loading the mempool.
When set, the node checks for the existence of a pause_load_mempool file and waits until that file is removed.
This PR uses the mechanism to test that savemempool fails before the mempool is loaded, and that getmempoolinfo’s “loaded” field is false.
The main motivation for this change is to enable test coverage for an enhancement of #34020, to have the new IPC methods throw an error while the mempool is loading from disk, rather than an ambiguous empty result.
The -test=pause_... mechanism may be generally useful for testing other init and shutdown steps.
The first commit extracts two useful helper methods to the test framework:
- it adds
wait_for_importto the newstart_breakablehelper right away, though it’s not used until the main commit - it changes one
node.process.send_signaltoself.sigterm_node(node), which I believe is equivalent - it merges two different comments around
node.process.send_signalfor Windows