You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change the assertion approach of
testGetCurrentThreadsWithStacktrace_WithSymbolication and
testGetCurrentThreadsWithStacktrace_WithoutSymbolication to validate
the percentage of threads having a stracktrace, which is more robust
than the previous method which failed if more than one thread had no
stacktrace frames. Especially during the test when launching multiple
threads for the concurrent DispatchQueue it can occur that more than
one thread have no stacktrace frames yet, because they just started.
// During testing we usually have around 90% to 100%
88
+
// We choose a bit lower threshold to avoid flaky tests in CI
89
+
// Especially during the test when launching multiple threads for the concurrent DispatchQueue
90
+
// it can occur that more than one thread have no stacktrace frames yet, because they just started.
91
+
XCTAssertGreaterThan(percantageWithStacktraceFrames,0.6,"More than 60% of threads should have stacktrace frames, but got \(percantageWithStacktraceFrames *100)%")
92
+
79
93
expect.fulfill()
80
94
}
81
95
}
82
-
96
+
83
97
queue.activate()
84
98
wait(for:[expect], timeout:10)
85
99
}
@@ -91,34 +105,45 @@ class SentryThreadInspectorTests: XCTestCase {
// During testing we usually have around 90% to 100%
138
+
// We choose a bit lower threshold to avoid flaky tests in CI
139
+
// Especially during the test when launching multiple threads for the concurrent DispatchQueue
140
+
// it can occur that more than one thread have no stacktrace frames yet, because they just started.
141
+
XCTAssertGreaterThan(percantageWithStacktraceFrames,0.6,"More than 60% of threads should have stacktrace frames, but got \(percantageWithStacktraceFrames *100)%")
0 commit comments