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: Make test_parallel more robust #17

Merged
merged 1 commit into from
Mar 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions test/functional/test_parallel/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@


def get_times(path: pathlib.Path) -> Set[float]:
"""Read the times from a target file with one second precision."""
return set(round(float(line), 1) for line in path.read_text().strip().split("\n"))
"""Given a file with two timestamps that span a time range, return the
timestamps of the range with 0.1 second precision.
"""
time0, time1 = (
round(float(line), 1) for line in path.read_text().strip().split("\n")
)
times = []
time = time0
while time <= time1:
times.append(time)
time = round(time + 0.1, 1)

return set(times)


def test_parallel(tmp_path, run, init_tmp_path):
Expand Down