Skip to content

Commit

Permalink
Add short sleeps to make ls test deterministic (#209)
Browse files Browse the repository at this point in the history
* Add short sleeps to make ls test deterministic

* lint
  • Loading branch information
Kimahriman authored Feb 13, 2025
1 parent f3fae1e commit 6e726c3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import re
import stat
import time
from datetime import datetime
from tempfile import TemporaryDirectory
from typing import Callable, Iterator, List, Literal, Optional, Tuple, overload
Expand Down Expand Up @@ -268,10 +269,15 @@ def parse_output(output: str) -> Iterator[Tuple[int, List[FileOutput]]]:
with client.create("/testfile1") as f:
f.write(bytes(range(10)))

# Make sure we wait a few milliseconds so we don't get the exact same timestamp
time.sleep(0.01)

with client.create("/testfile2") as f:
for i in range(1024):
f.write(i.to_bytes(4, "big"))

time.sleep(0.01)

client.mkdirs("/testdir")

directory = FileOutput("drwxr-xr-x", "-", "0", "/testdir")
Expand Down

0 comments on commit 6e726c3

Please sign in to comment.