Skip to content

Commit

Permalink
ci: add first mock request waiting time
Browse files Browse the repository at this point in the history
  • Loading branch information
YoloMao committed Oct 23, 2023
1 parent af1f226 commit efacaed
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<GrowingBaseEvent *> *events = [MockEventQueue.sharedQueue eventsFor:GrowingEventTypeCustom];
Expand All @@ -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 {
Expand Down

0 comments on commit efacaed

Please sign in to comment.