@@ -27,14 +27,17 @@ def test(self):
27
27
self , "stop here in main." , self .main_source_spec
28
28
)
29
29
30
+ short_time = 5000
31
+ long_time = short_time * 1000
32
+
30
33
# First set the timeout too short, and make sure we fail.
31
34
options = lldb .SBExpressionOptions ()
32
- options .SetTimeoutInMicroSeconds (10 )
35
+ options .SetTimeoutInMicroSeconds (short_time )
33
36
options .SetUnwindOnError (True )
34
37
35
38
frame = thread .GetFrameAtIndex (0 )
36
39
37
- value = frame .EvaluateExpression ("wait_a_while(1000000 )" , options )
40
+ value = frame .EvaluateExpression (f "wait_a_while({ long_time } )" , options )
38
41
self .assertTrue (value .IsValid ())
39
42
self .assertFalse (value .GetError ().Success ())
40
43
@@ -44,14 +47,14 @@ def test(self):
44
47
45
48
result = lldb .SBCommandReturnObject ()
46
49
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
48
51
)
49
52
self .assertEqual (return_value , lldb .eReturnStatusFailed )
50
53
51
54
# Okay, now do it again with long enough time outs:
52
55
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 )
55
58
self .assertTrue (value .IsValid ())
56
59
self .assertSuccess (value .GetError ())
57
60
@@ -61,15 +64,15 @@ def test(self):
61
64
62
65
result = lldb .SBCommandReturnObject ()
63
66
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
65
68
)
66
69
self .assertEqual (return_value , lldb .eReturnStatusSuccessFinishResult )
67
70
68
71
# Finally set the one thread timeout and make sure that doesn't change
69
72
# things much:
70
73
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 )
74
77
self .assertTrue (value .IsValid ())
75
78
self .assertSuccess (value .GetError ())
0 commit comments