@@ -27,14 +27,17 @@ def test(self):
2727 self , "stop here in main." , self .main_source_spec
2828 )
2929
30+ short_time = 5000
31+ long_time = short_time * 1000
32+
3033 # First set the timeout too short, and make sure we fail.
3134 options = lldb .SBExpressionOptions ()
32- options .SetTimeoutInMicroSeconds (10 )
35+ options .SetTimeoutInMicroSeconds (short_time )
3336 options .SetUnwindOnError (True )
3437
3538 frame = thread .GetFrameAtIndex (0 )
3639
37- value = frame .EvaluateExpression ("wait_a_while(1000000 )" , options )
40+ value = frame .EvaluateExpression (f "wait_a_while({ long_time } )" , options )
3841 self .assertTrue (value .IsValid ())
3942 self .assertFalse (value .GetError ().Success ())
4043
@@ -44,14 +47,14 @@ def test(self):
4447
4548 result = lldb .SBCommandReturnObject ()
4649 return_value = interp .HandleCommand (
47- "expr -t 100 -u true -- wait_a_while(1000000 )" , result
50+ f "expr -t { short_time } -u true -- wait_a_while({ long_time } )" , result
4851 )
4952 self .assertEqual (return_value , lldb .eReturnStatusFailed )
5053
5154 # Okay, now do it again with long enough time outs:
5255
53- options .SetTimeoutInMicroSeconds (1000000 )
54- value = frame .EvaluateExpression ("wait_a_while (1000 )" , options )
56+ options .SetTimeoutInMicroSeconds (long_time )
57+ value = frame .EvaluateExpression (f "wait_a_while( { short_time } )" , options )
5558 self .assertTrue (value .IsValid ())
5659 self .assertSuccess (value .GetError ())
5760
@@ -61,15 +64,15 @@ def test(self):
6164
6265 result = lldb .SBCommandReturnObject ()
6366 return_value = interp .HandleCommand (
64- "expr -t 1000000 -u true -- wait_a_while(1000 )" , result
67+ f "expr -t { long_time } -u true -- wait_a_while({ short_time } )" , result
6568 )
6669 self .assertEqual (return_value , lldb .eReturnStatusSuccessFinishResult )
6770
6871 # Finally set the one thread timeout and make sure that doesn't change
6972 # things much:
7073
71- options .SetTimeoutInMicroSeconds (1000000 )
72- options .SetOneThreadTimeoutInMicroSeconds (500000 )
73- value = frame .EvaluateExpression ("wait_a_while (1000 )" , options )
74+ options .SetTimeoutInMicroSeconds (long_time )
75+ options .SetOneThreadTimeoutInMicroSeconds (1000000 )
76+ value = frame .EvaluateExpression (f "wait_a_while( { short_time } )" , options )
7477 self .assertTrue (value .IsValid ())
7578 self .assertSuccess (value .GetError ())
0 commit comments