Skip to content

Commit

Permalink
Fix NetworkInstrumentationFeatureTests assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
maxep committed Dec 14, 2023
1 parent 894bf48 commit f99a874
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ class NetworkInstrumentationFeatureTests: XCTestCase {
.resume()

// Then
waitForExpectations(timeout: 5, handler: nil)
_ = server.waitAndReturnRequests(count: 1)
_ = server.waitAndReturnRequests(count: 2)

waitForExpectations(timeout: 5, handler: nil)
let dateAfterAllRequests = Date()

XCTAssertEqual(handler.interceptions.count, 2, "Interceptor should record metrics for 2 tasks")
Expand Down Expand Up @@ -286,11 +286,10 @@ class NetworkInstrumentationFeatureTests: XCTestCase {
.resume()

// Then
waitForExpectations(timeout: 5, handler: nil)
_ = server.waitAndReturnRequests(count: 1)
_ = server.waitAndReturnRequests(count: 2)

waitForExpectations(timeout: 5, handler: nil)
let dateAfterAllRequests = Date()

XCTAssertEqual(handler.interceptions.count, 2, "Interceptor should record metrics for 2 tasks")

try [url1, url2].forEach { url in
Expand Down

0 comments on commit f99a874

Please sign in to comment.