Skip to content

Commit

Permalink
Check if the error is happening during the renaming phases
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Kong committed Oct 18, 2024
1 parent a046bc3 commit 98013de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/fov_watcher_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ def _slow_copy_sample_tissue_data(
tissue_path = os.path.join(COMBINED_DATA_PATH, tissue_file)
if temp_bin and ".bin" in tissue_file:
# copy to a temporary file with hash extension, then move to dest folder
print(f"Copying over a temporary file with hash extension on {tissue_file}")
new_tissue_path = os.path.join(COMBINED_DATA_PATH, "." + tissue_file + ".aBcDeF")
shutil.copy(tissue_path, new_tissue_path)
shutil.copy(new_tissue_path, dest)
print(f"Removing the old tissue path at .{tissue_file}.aBcDeF")
os.remove(new_tissue_path)

# simulate a renaming event in dest
time.sleep(delta)
print(f"Renaming back to {tissue_file}")
copied_tissue_path = os.path.join(dest, "." + tissue_file + ".aBcDeF")
os.rename(copied_tissue_path, os.path.join(dest, tissue_file))

Expand Down

0 comments on commit 98013de

Please sign in to comment.