Skip to content

Commit

Permalink
Attempt to catch unit test failures more reliably
Browse files Browse the repository at this point in the history
  • Loading branch information
tskisner committed Mar 14, 2024
1 parent 7dbb4ed commit 88d4513
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pshmem/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,5 +471,17 @@ def run():
suite.addTest(unittest.makeSuite(LockTest))
suite.addTest(unittest.makeSuite(ShmemTest))
runner = unittest.TextTestRunner()
runner.run(suite)

ret = 0
_ret = runner.run(suite)
if not _ret.wasSuccessful():
ret += 1

if self.comm is not None:
ret = self.comm.allreduce(ret, op=MPI.SUM)

if ret > 0:
print(f"{ret} Processes had failures")
sys.exit(6)

return

0 comments on commit 88d4513

Please sign in to comment.