Skip to content

Commit 748df9d

Browse files
test: Remove infinity response delay (#5669)
Remove infinity response delay for the HTTPTransportTest, so we avoid having one item on the dispatch queue that would run forever. Instead, we can use the waitForResponseDispatchGroup.
1 parent 94a6b1a commit 748df9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Tests/SentryTests/Networking/SentryHttpTransportTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,11 +947,12 @@ class SentryHttpTransportTests: XCTestCase {
947947
let sut = fixture.getSut(dispatchQueueWrapper: SentryDispatchQueueWrapper())
948948
givenCachedEvents(amount: 1)
949949

950-
fixture.requestManager.responseDelay = .infinity
950+
fixture.requestManager.waitForResponseDispatchGroup = true
951+
fixture.requestManager.responseDispatchGroup.enter()
951952

952953
XCTAssertEqual(sut.flush(0.0), .timedOut, "Flush should time out.")
953954

954-
fixture.requestManager.responseDelay = 0.0
955+
self.fixture.requestManager.responseDispatchGroup.leave()
955956

956957
XCTAssertEqual(sut.flush(self.fixture.flushTimeout), .success, "Flush should not time out.")
957958
}

0 commit comments

Comments
 (0)