X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/873fcf181c037cc1e42419bfeaf5bb70c9d9e239..4d9a9766999dda4657bce039a1d56a5591201e95:/services/fuse/tests/integration_test.py diff --git a/services/fuse/tests/integration_test.py b/services/fuse/tests/integration_test.py index ae1b58ad47..24ac7baf04 100644 --- a/services/fuse/tests/integration_test.py +++ b/services/fuse/tests/integration_test.py @@ -16,6 +16,8 @@ import sys import tempfile import unittest +import pytest + from . import run_test_server @atexit.register @@ -91,9 +93,15 @@ class IntegrationTest(unittest.TestCase): return func(self, *args, **kwargs) finally: if self.mount and self.mount.llfuse_thread.is_alive(): - logging.warning("IntegrationTest.mount:" - " llfuse thread still alive after umount" - " -- killing test suite to avoid deadlock") - os.kill(os.getpid(), signal.SIGKILL) + # pytest uses exit status 2 when test collection failed. + # A UnitTest failing in setup/teardown counts as a + # collection failure, so pytest will exit with status 2 + # no matter what status you specify here. run-tests.sh + # looks for this status, so specify 2 just to keep + # everything as consistent as possible. + # TODO: If we refactor these tests so they're not built + # on unittest, consider using a dedicated, non-pytest + # exit code like TEMPFAIL. + pytest.exit("llfuse thread outlived test - aborting test suite to avoid deadlock", 2) return wrapper return decorator