Skip to content

Commit

Permalink
Loosen realtime test criteria to accomodate timing uncertainty
Browse files Browse the repository at this point in the history
  • Loading branch information
gvoskuilen committed Sep 20, 2024
1 parent 25f7fc4 commit 3fa6a2c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/testsuite_default_RealTime.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_RealTime_SIGUSR2(self):
num_lines = 101 + (threads * ranks) * 5
self.assertTrue(sig_found, "Output file is missing SIGUSR2 triggered output message")
self.assertTrue(exit_count >= num_para, "Exit message count incorrect, should be at least {0}, found {1} in {2}".format(exit_count,num_para,outfile))
self.assertTrue(line_count == num_lines, "Line count incorrect, should be {0}, found {1} in {2}".format(num_lines,line_count,outfile))
self.assertTrue(line_count >= num_lines, "Line count incorrect, should be at least {0}, found {1} in {2}".format(num_lines,line_count,outfile))

@unittest.skipIf(testing_check_get_num_ranks() > 1, "This test does not run reliably with mpirun")
def test_RealTime_SIGINT(self):
Expand Down Expand Up @@ -172,7 +172,7 @@ def test_RealTime_SIGALRM(self):
self.run_sst(sdlfile, outfile, other_args="--exit-after=6s --heartbeat-wall-period=1")

# Cannot diff test output because times may differ
# Check for 6 heartbeat messages
# Check for at least 5 heartbeat messages
# Check for ended due to exit-after
# Check for right number of lines in output
hb_count = 0
Expand All @@ -189,9 +189,10 @@ def test_RealTime_SIGALRM(self):
ranks = testing_check_get_num_ranks()
threads = testing_check_get_num_threads()
num_para = threads * ranks
num_lines = 131 + 2*num_para # basic heartbeat (30) + exit messages (1 + 2*para) + Component Finished messages (100)
num_lines = 126 + 2*num_para # basic heartbeat (>25) + exit messages (1 + 2*para) + Component Finished messages (100)
if ranks > 1:
num_lines += 12 # Extra heartbeat output for MPI
self.assertTrue(hb_count == 6, "Heartbeat count incorrect, should be 6, found {0} in {1}".format(hb_count,outfile))
self.assertTrue(hb_count >= 5, "Heartbeat count incorrect, should be at least 5, found {0} in {1}".format(hb_count,outfile))
self.assertTrue(exit_count == num_para, "Exit message count incorrect, should be {0}, found {1} in {2}".format(num_para,exit_count,outfile))
self.assertTrue(line_count == num_lines, "Line count incorrect, should be {0}, found {1} in {2}".format(num_lines,line_count,outfile))
self.assertTrue(line_count >= num_lines, "Line count incorrect, should be {0}, found {1} in {2}".format(num_lines,line_count,outfile))

0 comments on commit 3fa6a2c

Please sign in to comment.