Skip to content

Commit 3c23371

Browse files
fix: add wait before first push in second scenario
The failure was at line 358 - the FIRST push in the second scenario, not between pushes. The race condition occurs because the second scenario reuses the same repo name from the first scenario, and there may be a race between repo deletion completing and the new repo being ready. Add _wait_for_repo_ready after entering the second temporary_repo context to ensure the new repo is in a consistent state before the first push.
1 parent fab2e85 commit 3c23371

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/test_upstream_hub.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ def test_push_dataset_dict_to_hub_overwrite_files(self, temporary_repo):
355355
# Push to hub two times, but the second time with fewer files.
356356
# Verify that the new files contain the correct dataset and that non-necessary files have been deleted.
357357
with temporary_repo(ds_name):
358+
# Wait for repo to be ready after creation (avoid race with previous repo deletion)
359+
self._wait_for_repo_ready(ds_name)
360+
358361
local_ds.push_to_hub(ds_name, token=self._token, max_shard_size=500 << 5)
359362

360363
# Wait for Hub to fully process the first push

0 commit comments

Comments
 (0)