From 8982b03ac2312dec5bd0651693842530b2049ffb Mon Sep 17 00:00:00 2001 From: BryanFauble <17128019+BryanFauble@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:31:09 -0700 Subject: [PATCH] Remove more test logic --- .../synapseclient/core/test_caching.py | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/integration/synapseclient/core/test_caching.py b/tests/integration/synapseclient/core/test_caching.py index f39eb0b45..d13c605d0 100644 --- a/tests/integration/synapseclient/core/test_caching.py +++ b/tests/integration/synapseclient/core/test_caching.py @@ -10,7 +10,6 @@ from queue import Queue import pytest -import synapseclient import synapseclient.core.utils as utils from synapseclient.core.exceptions import SynapseError, SynapseHTTPError @@ -18,6 +17,13 @@ from func_timeout import FunctionTimedOut, func_set_timeout +@pytest.fixture(scope="module") +def project(syn, schedule_for_cleanup): + project = syn.store(Project(name=str(uuid.uuid4()))) + schedule_for_cleanup(project) + return project + + @pytest.fixture(scope="module", autouse=True) def syn_state(syn): syn.test_keepRunning = True @@ -36,19 +42,7 @@ def syn_state(syn): @pytest.mark.flaky(reruns=6) -def test_threaded_access(syn: Synapse, schedule_for_cleanup): - project = syn.store(Project(name=str(uuid.uuid4()))) - schedule_for_cleanup(project) - # try: - execute_test_threaded_access(syn, project, schedule_for_cleanup) - # except FunctionTimedOut: - # syn.test_keepRunning = False - # syn.logger.warning("test_threaded_access timed out") - # pytest.fail("test_threaded_access timed out") - - -# @func_set_timeout(120) -def execute_test_threaded_access(syn: Synapse, project: Project, schedule_for_cleanup): +def test_threaded_access(syn: Synapse, project: Project, schedule_for_cleanup): """Starts multiple threads to perform store and get calls randomly.""" # Doesn't this test look like a DOS attack on Synapse? # Maybe it should be called explicity... @@ -79,10 +73,8 @@ def execute_test_threaded_access(syn: Synapse, project: Project, schedule_for_cl thread.start_new_thread(update_thread, ()) # thread.start_new_thread(update_thread, ()) - syn.logger.warning(f"execute_test_threaded_access Starting sleep for 20 seconds") # Give the threads some time to wreak havoc on the cache time.sleep(20) - syn.logger.warning(f"execute_test_threaded_access Slept for 20 seconds") syn.test_keepRunning = False while syn.test_threadsRunning > 0: