Skip to content

Commit

Permalink
Remove more test logic
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanFauble committed Oct 27, 2023
1 parent 281ae27 commit 8982b03
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions tests/integration/synapseclient/core/test_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@
from queue import Queue

import pytest
import synapseclient

import synapseclient.core.utils as utils
from synapseclient.core.exceptions import SynapseError, SynapseHTTPError
from synapseclient import File, Project, Synapse, Entity
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
Expand All @@ -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...
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 8982b03

Please sign in to comment.