Skip to content

Commit

Permalink
Treat -SIGTERM + data received as a pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamshapiro0 committed Apr 14, 2021
1 parent 0b6f063 commit 69bf71d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions c/test/application_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,16 @@ def __init__(self, application_name):
self.data_received = False

def check_pass_fail(self, exit_code):
if exit_code == 0 and not self.data_received:
print('No corrections data received.')
return self.TEST_FAILED
# Note: There is currently a race condition when the subprocess is shutdown (SIGTERM) where either the
# application itself exits cleanly with code 0 as expected, or the Python fork running it exits first with
# -SIGTERM before the application gets a chance to exit. The preexec stuff above doesn't seem to be enough to
# fix it. For now, we simply treat the combination of -SIGTERM + data received as a pass.
if exit_code == 0 or exit_code == -signal.SIGTERM:
if self.data_received:
return self.TEST_PASSED
else:
print('No corrections data received.')
return self.TEST_FAILED
else:
return super().check_pass_fail(exit_code)

Expand Down

0 comments on commit 69bf71d

Please sign in to comment.