From 91a0e832d42abc2890d4f8871a14003de6a9919e Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 7 Aug 2023 08:49:13 +0000 Subject: [PATCH] [lldb] Make IR interpreter timeout test more loose This has failed once in a while on our Windows on Arm bot: https://lab.llvm.org/buildbot/#/builders/219/builds/4688 Traceback (most recent call last): File "C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\... self.assertGreaterEqual(duration_sec, 1) AssertionError: 0.9907491207122803 not greater than or equal to 1 We're not here to check that Python/the C++ lib/the OS implemented timers correctly, so accept anything 0.95 or greater. --- .../commands/expression/ir-interpreter/TestIRInterpreter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py b/lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py index 1b11d8e5ba05..5f98bb51a49c 100644 --- a/lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py +++ b/lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py @@ -44,7 +44,8 @@ class IRInterpreterTestCase(TestBase): options.SetTimeoutInMicroSeconds(1000000) res, duration_sec = self.time_expression(inf_loop, options) self.assertIn(timeout_error, str(res.GetError())) - self.assertGreaterEqual(duration_sec, 1) + # Anything within 5% of 1s is fine, to account for machine differences. + self.assertGreaterEqual(duration_sec, 0.95) self.assertLess(duration_sec, 30) def test_interpreter_interrupt(self):