From c9724f9b4fb6ebe4fb99135462d0e16ab35474e2 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 6 Mar 2023 23:34:53 -0900 Subject: [PATCH] end spans at end of test case (#2766) --- .../Performance/SentryPerformanceTrackerTests.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Tests/SentryTests/Integrations/Performance/SentryPerformanceTrackerTests.swift b/Tests/SentryTests/Integrations/Performance/SentryPerformanceTrackerTests.swift index 6565b7bcbdc..cbc2a629d09 100644 --- a/Tests/SentryTests/Integrations/Performance/SentryPerformanceTrackerTests.swift +++ b/Tests/SentryTests/Integrations/Performance/SentryPerformanceTrackerTests.swift @@ -19,7 +19,7 @@ class SentryPerformanceTrackerTests: XCTestCase { } func getSut() -> SentryPerformanceTracker { - return SentryPerformanceTracker() + return SentryPerformanceTracker() } } @@ -280,7 +280,7 @@ class SentryPerformanceTrackerTests: XCTestCase { let queue = DispatchQueue(label: "SentryPerformanceTrackerTests", attributes: [.concurrent, .initiallyInactive]) let group = DispatchGroup() - + for _ in 0 ..< 5_000 { group.enter() queue.async { @@ -294,6 +294,9 @@ class SentryPerformanceTrackerTests: XCTestCase { } let spans = getSpans(tracker: sut) XCTAssertEqual(spans.count, 5_001) + for span in spans { + sut.finishSpan(span.key) + } } func testStackAsync() {