@@ -53,20 +53,27 @@ def do_test(self):
53
53
runtimes .append (os .path .join (libspec .GetDirectory (), libspec .GetFilename ()))
54
54
self .registerSharedLibrariesWithTarget (target , runtimes )
55
55
56
- # Unfortunatley the runtime itself isn't 100% reliable in reporting TSAN errors.
57
- process = None
58
- stop_reason = lldb . eStopReasonInvalid
56
+ # Unfortunately the runtime itself isn't 100% reliable in reporting TSAN errors.
57
+ failure_reasons = []
58
+ stop_reason = None
59
59
for retry in range (5 ):
60
- process = target .LaunchSimple (None , None , self .get_process_working_directory ())
61
- if not process :
60
+ error = lldb .SBError ()
61
+ info = lldb .SBLaunchInfo ([exe_name ])
62
+ info .SetWorkingDirectory (self .get_process_working_directory ())
63
+ process = target .Launch (info , error )
64
+ if not error .success :
65
+ failure_reasons .append (f"Failed to bring up process, error: { error .value } " )
62
66
continue
67
+
63
68
stop_reason = process .GetSelectedThread ().GetStopReason ()
64
69
if stop_reason == lldb .eStopReasonInstrumentation :
65
70
break
71
+ failure_reasons .append (f"Invalid stop_reason: { stop_reason } " )
66
72
67
73
self .assertEqual (
68
- process .GetSelectedThread ().GetStopReason (),
69
- lldb .eStopReasonInstrumentation )
74
+ stop_reason ,
75
+ lldb .eStopReasonInstrumentation ,
76
+ f"Failed with { len (failure_reasons )} attempts with reasons: { failure_reasons } " )
70
77
71
78
# the stop reason of the thread should be a TSan report.
72
79
self .expect ("thread list" , "A Swift access race should be detected" ,
0 commit comments