From 3e8b5b0f9f3337ef3110c761f89829d1d8e5f5bf Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Wed, 8 May 2024 09:00:10 -0700 Subject: [PATCH] Update some tests to account for github slowness. (#342) * Update some tests to account for github slowness. * Corrected expected failure. --- Tests/Segment-Tests/Analytics_Tests.swift | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Tests/Segment-Tests/Analytics_Tests.swift b/Tests/Segment-Tests/Analytics_Tests.swift index 2e0af6b..5d92061 100644 --- a/Tests/Segment-Tests/Analytics_Tests.swift +++ b/Tests/Segment-Tests/Analytics_Tests.swift @@ -52,7 +52,7 @@ final class Analytics_Tests: XCTestCase { analytics.identify(userId: "brandon", traits: traits) analytics.remove(plugin: ziggy) - wait(for: [expectation], timeout: 1.0) + wait(for: [expectation], timeout: .infinity) } func testDestinationInitialUpdateOnlyOnce() { @@ -90,7 +90,7 @@ final class Analytics_Tests: XCTestCase { XCTAssertNotNil(dest) XCTAssertTrue(dest is MyDestination) - wait(for: [expectation], timeout: 1.0) + wait(for: [expectation], timeout: .infinity) XCTAssertEqual(myDestination.receivedInitialUpdate, 1) XCTAssertEqual(ziggy1.receivedInitialUpdate, 1) @@ -130,7 +130,7 @@ final class Analytics_Tests: XCTestCase { XCTAssertNotNil(dest) XCTAssertTrue(dest is MyDestination) - wait(for: [expectation], timeout: 1.0) + wait(for: [expectation], timeout: .infinity) } // Linux doesn't support XCTExpectFailure @@ -771,11 +771,7 @@ final class Analytics_Tests: XCTestCase { expectation.fulfill() } - #if os(iOS) - wait(for: [expectation]) - #else - wait(for: [expectation], timeout: 5) - #endif + wait(for: [expectation], timeout: .infinity) XCTAssertNil(analytics.pendingUploads) } @@ -800,7 +796,7 @@ final class Analytics_Tests: XCTestCase { expectation.fulfill() } - wait(for: [expectation], timeout: 10) + wait(for: [expectation], timeout: .infinity) XCTAssertNil(analytics.pendingUploads) @@ -915,7 +911,7 @@ final class Analytics_Tests: XCTestCase { expectation.fulfill() } - wait(for: [expectation], timeout: 1.0) + wait(for: [expectation], timeout: .infinity) let newStoredEvents: [URL]? = analytics.storage.read(.events)