Skip to content

Commit

Permalink
Make PBS tests more tolerant for SIGTERM variants
Browse files Browse the repository at this point in the history
At least on RHEL8 and Python 3.11 the return code from PBS has been observed to
be 128 + SIGTERM while at least on RHEL7/Python 3.8 it is 256 + SIGTERM.

We should accept both variants in tests.
  • Loading branch information
berland committed Mar 15, 2024
1 parent b12d8f6 commit 01edea6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/integration_tests/scheduler/test_generic_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,20 @@ async def finished(iens, returncode, aborted):
async def test_kill(driver):
aborted_called = False

expected_returncode = 1
expected_returncodes = [1]
if isinstance(driver, OpenPBSDriver):
expected_returncode = 256 + signal.SIGTERM
expected_returncodes = [128 + signal.SIGTERM, 256 + signal.SIGTERM]

if isinstance(driver, LocalDriver):
expected_returncode = -signal.SIGTERM
expected_returncodes = [-signal.SIGTERM]

async def started(iens):
nonlocal driver
await driver.kill(iens)

async def finished(iens, returncode, aborted):
assert iens == 0
assert returncode == expected_returncode
assert returncode in expected_returncodes
assert aborted is True

nonlocal aborted_called
Expand Down

0 comments on commit 01edea6

Please sign in to comment.