Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(artifacts): replace sleeps with flush when waiting on a file to write #4523

Merged
merged 3 commits into from
Nov 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions tests/unit_tests/test_wandb_artifacts_cache.py
Expand Up @@ -2,7 +2,6 @@
import os
import pathlib
import random
import time
from multiprocessing import Pool

import pytest
Expand Down Expand Up @@ -162,13 +161,13 @@ def test_artifacts_cache_cleanup():
os.makedirs(path_1)
with open(os.path.join(path_1, "aardvark"), "w") as f:
f.truncate(5000)
time.sleep(0.1)
f.flush()

path_2 = os.path.join(cache_root, "ab")
os.makedirs(path_2)
with open(os.path.join(path_2, "absolute"), "w") as f:
f.truncate(2000)
time.sleep(0.1)
f.flush()

path_3 = os.path.join(cache_root, "ac")
os.makedirs(path_3)
Expand Down