Skip to content

Commit 0c06dbf

Browse files
authored
Fix static Space e2e repo id suffix generation (#507)
1 parent 3b397df commit 0c06dbf

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/e2e-spaces/test_sync_and_freeze.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ def _namespace_scoped_repo_id(test_space_id: str, repo_name: str) -> str:
5656
return repo_name
5757

5858

59+
def _repo_safe_suffix(nbytes: int = 6) -> str:
60+
return secrets.token_hex(nbytes)
61+
62+
5963
def test_sync_to_gradio_space(test_space_id, temp_dir):
6064
project_name = f"test_sync_gradio_{secrets.token_urlsafe(8)}"
6165
run_name = "run1"
@@ -90,7 +94,7 @@ def test_sync_to_gradio_space(test_space_id, temp_dir):
9094
def test_sync_to_static_space_incremental(test_space_id, temp_dir):
9195
project_name = f"test_sync_static_{secrets.token_urlsafe(8)}"
9296
run_name = "run1"
93-
suffix = secrets.token_urlsafe(6)
97+
suffix = _repo_safe_suffix()
9498
space_id = _namespace_scoped_repo_id(test_space_id, f"trackio-test-static-{suffix}")
9599
space_id, _, bucket_id = utils.preprocess_space_and_dataset_ids(space_id, None)
96100

@@ -137,7 +141,7 @@ def test_sync_gradio_then_freeze_to_static(test_space_id, temp_dir):
137141
client.predict(api_name="/force_sync")
138142
time.sleep(5)
139143

140-
suffix = secrets.token_urlsafe(6)
144+
suffix = _repo_safe_suffix()
141145
frozen_space_id = _namespace_scoped_repo_id(
142146
test_space_id, f"trackio-test-frozen-{suffix}"
143147
)

0 commit comments

Comments
 (0)