From efacaedf792a7d8f7130e1bbf09ca6bb8158e6df Mon Sep 17 00:00:00 2001 From: YoloMao Date: Mon, 23 Oct 2023 14:29:44 +0800 Subject: [PATCH] ci: add first mock request waiting time --- .../ModulesTests/ABTestingTests/ABTestingTests.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Example/GrowingAnalyticsTests/ModulesTests/ABTestingTests/ABTestingTests.m b/Example/GrowingAnalyticsTests/ModulesTests/ABTestingTests/ABTestingTests.m index 303a568fc..e35cd7f2b 100644 --- a/Example/GrowingAnalyticsTests/ModulesTests/ABTestingTests/ABTestingTests.m +++ b/Example/GrowingAnalyticsTests/ModulesTests/ABTestingTests/ABTestingTests.m @@ -149,7 +149,7 @@ - (void)test01FetchSuccess { XCTestExpectation *expectation = [self expectationWithDescription:@"testFetchSuccess Test failed : timeout"]; expectation.expectedFulfillmentCount = 2; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ XCTAssertEqual(requestCount, 1); NSArray *events = [MockEventQueue.sharedQueue eventsFor:GrowingEventTypeCustom]; @@ -169,12 +169,12 @@ - (void)test01FetchSuccess { // 2次获取的实验对象相同 XCTAssert([lastExp isEqual:exp]); }]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ XCTAssertEqual(requestCount, 1); [expectation fulfill]; }); }); - [self waitForExpectationsWithTimeout:5.0f handler:nil]; + [self waitForExpectationsWithTimeout:10.0f handler:nil]; } - (void)test02FetchWrongLayerId {