Skip to content

Commit

Permalink
remove wait secs test
Browse files Browse the repository at this point in the history
this test will always be unreliable due to the way floating point math works and the limited persission of some cpu clocks
  • Loading branch information
jenshnielsen committed Apr 16, 2021
1 parent 74bd425 commit 91fa00d
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions qcodes/tests/helpers/test_waitsecs.py
Expand Up @@ -13,19 +13,6 @@ def test_bad_calls():
wait_secs(arg)


def test_good_calls():
for secs in [0.001, 0.003, 0.01, 0.03, 0.1, 0.3, 1]:
finish_clock = time.perf_counter() + secs
secs_out = wait_secs(finish_clock)
assert secs_out > secs - 3e-4
# add a tiny offset as this test may fail if
# otherwise if the two calls to perf_counter are close
# enough to return the same result as a + b - a cannot
# in general be assumed to be <= b in floating point
# math (here a is perf_counter() and b is the wait time
assert secs_out <= secs + 1e-14


def test_warning():
with LogCapture() as logs:
secs_out = wait_secs(time.perf_counter() - 1)
Expand Down

0 comments on commit 91fa00d

Please sign in to comment.