[Lldb-commits] [lldb] 14ba847 - [lldb] Bump timeouts in TestCallWithTimeout
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 10 02:37:12 PDT 2024
Author: Pavel Labath
Date: 2024-07-10T09:36:26Z
New Revision: 14ba847d273a0defe0f4617bcfe9e1b2163e2bbc
URL: https://github.com/llvm/llvm-project/commit/14ba847d273a0defe0f4617bcfe9e1b2163e2bbc
DIFF: https://github.com/llvm/llvm-project/commit/14ba847d273a0defe0f4617bcfe9e1b2163e2bbc.diff
LOG: [lldb] Bump timeouts in TestCallWithTimeout
this test is occasionally (~3%) failing on an emulator target. The value
used by the test (one second) is quite aggressive given that we set the timeout
for a single gdb packet to 60 seconds.
Bumping it to five to resolve flakyness.
Added:
Modified:
lldb/test/API/commands/expression/timeout/TestCallWithTimeout.py
Removed:
################################################################################
diff --git a/lldb/test/API/commands/expression/timeout/TestCallWithTimeout.py b/lldb/test/API/commands/expression/timeout/TestCallWithTimeout.py
index 2c48024c69833..de074e8ff7b09 100644
--- a/lldb/test/API/commands/expression/timeout/TestCallWithTimeout.py
+++ b/lldb/test/API/commands/expression/timeout/TestCallWithTimeout.py
@@ -27,14 +27,17 @@ def test(self):
self, "stop here in main.", self.main_source_spec
)
+ short_time = 5000
+ long_time = short_time * 1000
+
# First set the timeout too short, and make sure we fail.
options = lldb.SBExpressionOptions()
- options.SetTimeoutInMicroSeconds(10)
+ options.SetTimeoutInMicroSeconds(short_time)
options.SetUnwindOnError(True)
frame = thread.GetFrameAtIndex(0)
- value = frame.EvaluateExpression("wait_a_while(1000000)", options)
+ value = frame.EvaluateExpression(f"wait_a_while({long_time})", options)
self.assertTrue(value.IsValid())
self.assertFalse(value.GetError().Success())
@@ -44,14 +47,14 @@ def test(self):
result = lldb.SBCommandReturnObject()
return_value = interp.HandleCommand(
- "expr -t 100 -u true -- wait_a_while(1000000)", result
+ f"expr -t {short_time} -u true -- wait_a_while({long_time})", result
)
self.assertEqual(return_value, lldb.eReturnStatusFailed)
# Okay, now do it again with long enough time outs:
- options.SetTimeoutInMicroSeconds(1000000)
- value = frame.EvaluateExpression("wait_a_while (1000)", options)
+ options.SetTimeoutInMicroSeconds(long_time)
+ value = frame.EvaluateExpression(f"wait_a_while({short_time})", options)
self.assertTrue(value.IsValid())
self.assertSuccess(value.GetError())
@@ -61,15 +64,15 @@ def test(self):
result = lldb.SBCommandReturnObject()
return_value = interp.HandleCommand(
- "expr -t 1000000 -u true -- wait_a_while(1000)", result
+ f"expr -t {long_time} -u true -- wait_a_while({short_time})", result
)
self.assertEqual(return_value, lldb.eReturnStatusSuccessFinishResult)
# Finally set the one thread timeout and make sure that doesn't change
# things much:
- options.SetTimeoutInMicroSeconds(1000000)
- options.SetOneThreadTimeoutInMicroSeconds(500000)
- value = frame.EvaluateExpression("wait_a_while (1000)", options)
+ options.SetTimeoutInMicroSeconds(long_time)
+ options.SetOneThreadTimeoutInMicroSeconds(1000000)
+ value = frame.EvaluateExpression(f"wait_a_while({short_time})", options)
self.assertTrue(value.IsValid())
self.assertSuccess(value.GetError())
More information about the lldb-commits
mailing list