From 9bbba9790d1e010833f1d555344d7fff70ab58c2 Mon Sep 17 00:00:00 2001 From: BryanFauble <17128019+BryanFauble@users.noreply.github.com> Date: Fri, 27 Oct 2023 15:07:55 -0700 Subject: [PATCH] Wrap test in 2 min timeout --- .../synapseutils/test_synapseutils_copy.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/integration/synapseutils/test_synapseutils_copy.py b/tests/integration/synapseutils/test_synapseutils_copy.py index 769ea9cff..9d3a28213 100644 --- a/tests/integration/synapseutils/test_synapseutils_copy.py +++ b/tests/integration/synapseutils/test_synapseutils_copy.py @@ -2,6 +2,7 @@ import time import re import json +from func_timeout import FunctionTimedOut, func_set_timeout import pytest @@ -28,6 +29,16 @@ # Add test for existing provenance but the orig doesn't have provenance @pytest.mark.flaky(reruns=3) def test_copy(syn: Synapse, schedule_for_cleanup): + try: + execute_test_copy(syn, schedule_for_cleanup) + except FunctionTimedOut: + syn.logger.warning("test_copy timed out") + pytest.fail("test_copy timed out") + + +# When running with multiple threads it can lock up and do nothing until pipeline is killed at 6hrs +@func_set_timeout(120) +def execute_test_copy(syn: Synapse, schedule_for_cleanup): """Tests the copy function""" # Create a Project project_entity = syn.store(Project(name=str(uuid.uuid4())))