diff --git a/parsl/tests/conftest.py b/parsl/tests/conftest.py index a35493810e..fcfd2a594e 100644 --- a/parsl/tests/conftest.py +++ b/parsl/tests/conftest.py @@ -243,7 +243,7 @@ def setup_data(tmpd_cwd): @pytest.fixture(autouse=True, scope='function') -def wait_for_task_completion(pytestconfig): +def assert_no_outstanding_tasks(pytestconfig): """If we're in a config-file based mode, wait for task completion between each test. This will detect early on (by hanging) if particular test tasks are not finishing, rather than silently falling off the end of @@ -254,7 +254,11 @@ def wait_for_task_completion(pytestconfig): config = pytestconfig.getoption('config')[0] yield if config != 'local': - parsl.dfk().wait_for_current_tasks() + logger.info("Checking no outstanding tasks") + for task_record in parsl.dfk().tasks.values(): + fut = task_record['app_fu'] + assert fut.done(), f"Incomplete task found, task id {task_record['id']}" + logger.info("No outstanding tasks found") def pytest_make_collect_report(collector): diff --git a/parsl/tests/test_python_apps/test_lifted.py b/parsl/tests/test_python_apps/test_lifted.py index 644792205a..30103d85de 100644 --- a/parsl/tests/test_python_apps/test_lifted.py +++ b/parsl/tests/test_python_apps/test_lifted.py @@ -89,8 +89,10 @@ def test_returns_a_class_instance(): def test_returns_a_class_instance_no_underscores(): # test that _underscore attribute references are not lifted + f = returns_a_class_instance() with pytest.raises(AttributeError): - returns_a_class_instance()._nosuchattribute.result() + f._nosuchattribute.result() + f.exception() # wait for f to complete before the test ends @pytest.mark.skip("returning classes is not supported in WorkQueue or Task Vine - see issue #2908")