@@ -21,6 +21,7 @@ def run_test(self):
21
21
self .run_and_check_miner_scenario_from_file ()
22
22
self .run_and_check_scenario_from_file ()
23
23
self .check_regtest_recon ()
24
+ self .check_active_count ()
24
25
finally :
25
26
self .cleanup ()
26
27
@@ -76,6 +77,8 @@ def run_and_check_miner_scenario_from_file(self):
76
77
start = int (self .warnet ("bitcoin rpc tank-0000 getblockcount" ))
77
78
self .wait_for_predicate (lambda : self .scenario_running ("commander-minerstd" ))
78
79
self .wait_for_predicate (lambda : self .check_blocks (2 , start = start ))
80
+ table = self .warnet ("status" )
81
+ assert "Active Scenarios: 1" in table
79
82
self .stop_scenario ()
80
83
81
84
def run_and_check_scenario_from_file (self ):
@@ -90,6 +93,22 @@ def check_regtest_recon(self):
90
93
self .warnet (f"run { scenario_file } " )
91
94
self .wait_for_predicate (self .check_scenario_clean_exit )
92
95
96
+ def check_active_count (self ):
97
+ scenario_file = "test/data/scenario_buggy_failure.py"
98
+ self .log .info (f"Running scenario from: { scenario_file } " )
99
+ self .warnet (f"run { scenario_file } " )
100
+
101
+ def two_pass_one_fail ():
102
+ deployed = scenarios_deployed ()
103
+ if len ([s for s in deployed if s ["status" ] == "succeeded" ]) != 2 :
104
+ return False
105
+ if len ([s for s in deployed if s ["status" ] == "failed" ]) != 1 :
106
+ return False
107
+ return True
108
+ self .wait_for_predicate (two_pass_one_fail )
109
+ table = self .warnet ("status" )
110
+ assert "Active Scenarios: 0" in table
111
+
93
112
94
113
if __name__ == "__main__" :
95
114
test = ScenariosTest ()
0 commit comments