Skip to content

Commit

Permalink
remove tenacity use for test_store.py
Browse files Browse the repository at this point in the history
  • Loading branch information
GiaJordan committed Nov 20, 2023
1 parent adf64e2 commit 73efa56
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions tests/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
from synapseclient import EntityViewSchema, Folder
from synapseclient.core.exceptions import SynapseHTTPError
from synapseclient.entity import File
from tenacity import (RetryError, Retrying, stop_after_attempt,
wait_random_exponential)

from schematic.configuration.configuration import Configuration
from schematic.models.metadata import MetadataModel
Expand Down Expand Up @@ -153,24 +151,15 @@ def test_annotation_submission(self, synapse_store, helpers, manifest_path, test
# Upload dataset annotations
sg = SchemaGenerator(config.model_location)

try:
for attempt in Retrying(
stop = stop_after_attempt(5),
wait = wait_random_exponential(multiplier=1,min=10,max=20),
retry_error_callback = raise_final_error
):
with attempt:
manifest_id = synapse_store.associateMetadataWithFiles(
schemaGenerator = sg,
metadataManifestPath = helpers.get_data_path(manifest_path),
datasetId = datasetId,
manifest_record_type = manifest_record_type,
useSchemaLabel = True,
hideBlanks = True,
restrict_manifest = False,
)
except RetryError:
pass
manifest_id = synapse_store.associateMetadataWithFiles(
schemaGenerator = sg,
metadataManifestPath = helpers.get_data_path(manifest_path),
datasetId = datasetId,
manifest_record_type = manifest_record_type,
useSchemaLabel = True,
hideBlanks = True,
restrict_manifest = False,
)

# Retrive annotations
entity_id = helpers.get_data_frame(manifest_path)["entityId"][0]
Expand Down

0 comments on commit 73efa56

Please sign in to comment.