Skip to content

Commit

Permalink
Merge pull request #2026 from Giskard-AI/fix/tests-randomly-failing
Browse files Browse the repository at this point in the history
Fixed randomly failing tests
  • Loading branch information
kevinmessiaen authored Sep 18, 2024
2 parents 004cca3 + a5c6984 commit cfc1347
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_import_giskard.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ def test_import_giskard():
start = time()

# Start subprocess to ensure that giskard is not already imported
subprocess.run(["python", "-c", "import giskard"])
# Average of 10 imports to avoid random issues
for _ in range(10):
subprocess.run(["python", "-c", "import giskard"])

end = time()
assert (
end - start < IMPORT_TIME_THRESHOLD_SECOND
), f"Import of Giskard took {end - start} seconds (maximum threshold is set to {IMPORT_TIME_THRESHOLD_SECOND} second)"
end - start
) / 10 < IMPORT_TIME_THRESHOLD_SECOND, f"Import of Giskard took {(end - start) / 10} seconds on average (maximum threshold is set to {IMPORT_TIME_THRESHOLD_SECOND} second)"

0 comments on commit cfc1347

Please sign in to comment.