MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / run_test

Method run_test

test/functional/feature_abortnode.py:24–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22 # We'll connect the nodes later
23
24 def run_test(self):
25 self.generate(self.nodes[0], 3, sync_fun=self.no_op)
26
27 # Deleting the undo file will result in reorg failure
28 (self.nodes[0].blocks_path / "rev00000.dat").unlink()
29
30 # Connecting to a node with a more work chain will trigger a reorg
31 # attempt.
32 self.generate(self.nodes[1], 3, sync_fun=self.no_op)
33 with self.nodes[0].assert_debug_log(["Failed to disconnect block"]):
34 self.connect_nodes(0, 1)
35 self.generate(self.nodes[1], 1, sync_fun=self.no_op)
36
37 # Check that node0 aborted
38 self.log.info("Waiting for crash")
39 self.nodes[0].wait_until_stopped(timeout=5, expect_error=True, expected_stderr="Error: A fatal internal error occurred, see debug.log for details: Failed to disconnect block.")
40 self.log.info("Node crashed - now verifying restart fails")
41 self.nodes[0].assert_start_raises_init_error()
42
43
44if __name__ == '__main__':

Callers

nothing calls this directly

Calls 6

assert_debug_logMethod · 0.80
connect_nodesMethod · 0.80
infoMethod · 0.80
wait_until_stoppedMethod · 0.80
generateMethod · 0.45

Tested by

no test coverage detected