Skip to content

Commit

Permalink
minor: add variability in key used to check S3 store to avoid potenti…
Browse files Browse the repository at this point in the history
…al failures because of race conditions in CI
  • Loading branch information
the-forest-tree committed Nov 25, 2024
1 parent f8fa2ac commit 595629a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hrflow_connectors/core/backend/s3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import os
import secrets
import typing as t
from io import BytesIO

Expand Down Expand Up @@ -55,7 +56,7 @@ class CannotReadFromS3Error(Exception):

def check_store_pydantic(state: InternalState):
root_model = create_model("S3StoreRoot", root="HrFlow Connectors", store=NAME)
root_key = "__root"
root_key = f"__root_{secrets.token_hex(4)}"
root = root_model()
try:
save(state, root_key, root)
Expand All @@ -77,7 +78,7 @@ def check_store_msgspec(state: InternalState):
root_model = defstruct(
"S3StoreRoot", [("root", str, "HrFlow Connectors"), ("store", str, NAME)]
)
root_key = "__root"
root_key = f"__root_{secrets.token_hex(4)}"
root = root_model()
try:
save(state, root_key, root)
Expand Down

0 comments on commit 595629a

Please sign in to comment.