Skip to content

Commit 99f27fc

Browse files
authored
Merge pull request #85812 from carlpeto/eng/PR-165728982
[Test] Fix unstable Backtracing unit test
2 parents fbb420f + 2b1b10c commit 99f27fc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/Backtracing/CrashWithThreads.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func spawnThread(_ shouldCrash: Bool) {
5757

5858
let crashingThreadIndex = (1..<10).randomElement()
5959

60-
for threadIndex in 0..<10 {
60+
for threadIndex in 1..<10 {
6161
spawnThread(threadIndex == crashingThreadIndex)
6262
}
6363

@@ -69,9 +69,11 @@ while (true) {
6969

7070
// make sure there are no threads before the crashing thread (rdar://164566321)
7171

72-
// CHECK-NOT: Thread {{[0-9]+}}:
72+
// we expect the first thread not to be thread 0, it should be the crashing thread instead
73+
// CHECK-NOT: Thread 0{{( ".*")?}}:
7374

74-
// CHECK: Thread {{[1-9]+}} {{(".*" )?}}crashed:
75+
// we expect a crash on a thread other than 0
76+
// CHECK: Thread {{[1-9][0-9]*}} {{(".*" )?}}crashed:
7577

7678
// CHECK: 0 0x{{[0-9a-f]+}} reallyCrashMe() + {{[0-9]+}} in CrashWithThreads at {{.*}}/CrashWithThreads
7779
// CHECK-NEXT: 1 [ra] 0x{{[0-9a-f]+}} crashMe() + {{[0-9]+}} in CrashWithThreads at {{.*}}/CrashWithThreads

0 commit comments

Comments
 (0)