MCPcopy Create free account
hub / github.com/ElementsProject/elements / run_test

Method run_test

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

Source from the content-addressed store, hash-verified

26 # We'll connect the nodes later
27
28 def run_test(self):
29 self.generate(self.nodes[0], 3, sync_fun=self.no_op)
30 datadir = get_datadir_path(self.options.tmpdir, 0)
31
32 # Deleting the undo file will result in reorg failure
33 os.unlink(os.path.join(datadir, self.chain, 'blocks', 'rev00000.dat'))
34
35 # Connecting to a node with a more work chain will trigger a reorg
36 # attempt.
37 self.generate(self.nodes[1], 3, sync_fun=self.no_op)
38 with self.nodes[0].assert_debug_log(["Failed to disconnect block"]):
39 self.connect_nodes(0, 1)
40 self.generate(self.nodes[1], 1, sync_fun=self.no_op)
41
42 # Check that node0 aborted
43 self.log.info("Waiting for crash")
44 self.nodes[0].wait_until_stopped(timeout=200)
45 self.log.info("Node crashed - now verifying restart fails")
46 self.nodes[0].assert_start_raises_init_error()
47
48
49if __name__ == '__main__':

Callers

nothing calls this directly

Calls 8

get_datadir_pathFunction · 0.90
connect_nodesMethod · 0.80
infoMethod · 0.80
generateMethod · 0.45
joinMethod · 0.45
assert_debug_logMethod · 0.45
wait_until_stoppedMethod · 0.45

Tested by

no test coverage detected