File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Tests/SentryTests/Networking Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -671,22 +671,25 @@ class SentryHttpTransportTests: XCTestCase {
671671
672672 let queue = fixture. queue
673673
674- let group = DispatchGroup ( )
675- for _ in 0 ... 20 {
676- group. enter ( )
674+ let loopCount = 21
675+
676+ let expectation = XCTestExpectation ( description: " Send envelopes concurrently " )
677+ expectation. expectedFulfillmentCount = loopCount
678+
679+ for _ in 0 ..< loopCount {
677680 queue. async {
678681 self . givenRecordedLostEvents ( )
679682 self . sendEventAsync ( )
680- group . leave ( )
683+ expectation . fulfill ( )
681684 }
682685 }
683686
684687 queue. activate ( )
685- group . waitWithTimeout ( )
688+ wait ( for : [ expectation ] , timeout : 10 )
686689
687690 waitForAllRequests ( )
688691
689- XCTAssertEqual ( self . fixture. requestManager. requests. count, 21 )
692+ XCTAssertEqual ( self . fixture. requestManager. requests. count, loopCount )
690693 }
691694
692695 func testBuildingRequestFails_DeletesEnvelopeAndSendsNext( ) {
You can’t perform that action at this time.
0 commit comments