Skip to content

Commit

Permalink
tests: weaken timing criteria for caching
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Sep 26, 2023
1 parent 4017c43 commit 4bf37ef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ def test_api_requests_cache_no_parameters():
api = common.get_api()
t0 = time.monotonic()
api.get("status_show")
t1 = time.monotonic()
for ii in range(100):
t1 = time.perf_counter()
for ii in range(50):
api.get("status_show")
t2 = time.monotonic()
t2 = time.perf_counter()
assert (t1 - t0) > (t2 - t1)


Expand All @@ -20,8 +20,8 @@ def test_api_requests_cache_with_parameters():
api = common.get_api()
t0 = time.monotonic()
api.get("organization_list_for_user", permission="create_dataset")
t1 = time.monotonic()
for ii in range(100):
t1 = time.perf_counter()
for ii in range(50):
api.get("organization_list_for_user", permission="create_dataset")
t2 = time.monotonic()
t2 = time.perf_counter()
assert (t1 - t0) > (t2 - t1)

0 comments on commit 4bf37ef

Please sign in to comment.