Skip to content
Snippets Groups Projects
Commit 6c7c3dcc authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Tom Rini
Browse files

test/py/tests/test_sleep.py: test time approximately


On qemu errors like
assert 2.999650001525879 >= 3
occur.

According to the comment in the code the test is meant to be
approximate. So we should accept some milliseconds less.

Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: default avatarStephen Warren <swarren@nvidia.com>
parent 59ab72d7
Branches
Tags
No related merge requests found
......@@ -17,7 +17,7 @@ def test_sleep(u_boot_console):
u_boot_console.run_command('sleep %d' % sleep_time)
tend = time.time()
elapsed = tend - tstart
assert elapsed >= sleep_time
assert elapsed >= (sleep_time - 0.01)
if not u_boot_console.config.gdbserver:
# 0.25s margin is hopefully enough to account for any system overhead.
assert elapsed < (sleep_time + 0.25)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment