X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/afb710394b65fc82da8e4edd024a3a5fc1a18d54..d6e8bf4f423aa174f38b552161dd7bc2dd1ecb18:/services/fuse/tests/integration_test.py diff --git a/services/fuse/tests/integration_test.py b/services/fuse/tests/integration_test.py index ba9cd88eb7..89b39dbc87 100644 --- a/services/fuse/tests/integration_test.py +++ b/services/fuse/tests/integration_test.py @@ -2,28 +2,24 @@ # # SPDX-License-Identifier: AGPL-3.0 +from __future__ import absolute_import import arvados import arvados_fuse import arvados_fuse.command import atexit import functools import inspect -import llfuse import logging import multiprocessing import os -import run_test_server +from . import run_test_server import signal import sys import tempfile import unittest -_pool = None - - @atexit.register def _pool_cleanup(): - global _pool if _pool is None: return _pool.close() @@ -37,6 +33,17 @@ def wrap_static_test_method(modName, clsName, funcName, args, kwargs): Test().runTest(*args, **kwargs) +# To avoid Python's threading+multiprocessing=deadlock problems, we +# use a single global pool with maxtasksperchild=None for the entire +# test suite. +_pool = None +def workerPool(): + global _pool + if _pool is None: + _pool = multiprocessing.Pool(processes=1, maxtasksperchild=None) + return _pool + + class IntegrationTest(unittest.TestCase): def pool_test(self, *args, **kwargs): """Run a static method as a unit test, in a different process. @@ -44,20 +51,17 @@ class IntegrationTest(unittest.TestCase): If called by method 'foobar', the static method '_foobar' of the same class will be called in the other process. """ - global _pool - if _pool is None: - _pool = multiprocessing.Pool(1, maxtasksperchild=1) modName = inspect.getmodule(self).__name__ clsName = self.__class__.__name__ funcName = inspect.currentframe().f_back.f_code.co_name - _pool.apply( + workerPool().apply( wrap_static_test_method, (modName, clsName, '_'+funcName, args, kwargs)) @classmethod def setUpClass(cls): run_test_server.run() - run_test_server.run_keep(enforce_permissions=True, num_servers=2) + run_test_server.run_keep(blob_signing=True, num_servers=2) @classmethod def tearDownClass(cls): @@ -77,10 +81,6 @@ class IntegrationTest(unittest.TestCase): def decorator(func): @functools.wraps(func) def wrapper(self, *args, **kwargs): - # Workaround for llfuse deadlock bug. See #10805, #8345, - # https://bitbucket.org/nikratio/python-llfuse/issues/108 - llfuse.close = lambda *args: None - self.mount = None try: with arvados_fuse.command.Mount(