@@ -21,6 +21,7 @@ def run_test(self):
2121 self .run_and_check_miner_scenario_from_file ()
2222 self .run_and_check_scenario_from_file ()
2323 self .check_regtest_recon ()
24+ self .check_active_count ()
2425 finally :
2526 self .cleanup ()
2627
@@ -76,6 +77,8 @@ def run_and_check_miner_scenario_from_file(self):
7677 start = int (self .warnet ("bitcoin rpc tank-0000 getblockcount" ))
7778 self .wait_for_predicate (lambda : self .scenario_running ("commander-minerstd" ))
7879 self .wait_for_predicate (lambda : self .check_blocks (2 , start = start ))
80+ table = self .warnet ("status" )
81+ assert "Active Scenarios: 1" in table
7982 self .stop_scenario ()
8083
8184 def run_and_check_scenario_from_file (self ):
@@ -90,6 +93,22 @@ def check_regtest_recon(self):
9093 self .warnet (f"run { scenario_file } " )
9194 self .wait_for_predicate (self .check_scenario_clean_exit )
9295
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+
93112
94113if __name__ == "__main__" :
95114 test = ScenariosTest ()
0 commit comments