U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] test/py/tests/test_sleep.py: test time approximately
@ 2017-10-05 19:52 Heinrich Schuchardt
  2017-10-05 21:10 ` Stephen Warren
  0 siblings, 1 reply; 8+ messages in thread
From: Heinrich Schuchardt @ 2017-10-05 19:52 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 test/py/tests/test_sleep.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py
index b59a4cfc0f..5f0c4c2bfc 100644
--- a/test/py/tests/test_sleep.py
+++ b/test/py/tests/test_sleep.py
@@ -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.25)
     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)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-10-17  0:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-05 19:52 [U-Boot] [PATCH 1/1] test/py/tests/test_sleep.py: test time approximately Heinrich Schuchardt
2017-10-05 21:10 ` Stephen Warren
2017-10-05 21:15   ` Tom Rini
2017-10-05 22:33   ` Heinrich Schuchardt
2017-10-13 20:12     ` Stephen Warren
2017-10-13 20:28       ` [U-Boot] [PATCH v2 " Heinrich Schuchardt
2017-10-13 20:35         ` Stephen Warren
2017-10-17  0:48         ` [U-Boot] [U-Boot, v2, " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox