Merge pull request #25439 from yulin-liang/flaky-test

Extend timeout for streaming calls
pull/25169/head
yulin liang 4 years ago committed by GitHub
commit fe114b21ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      src/objective-c/tests/InteropTests/InteropTests.m

@ -38,6 +38,7 @@
#import "InteropTestsBlockCallbacks.h" #import "InteropTestsBlockCallbacks.h"
#define TEST_TIMEOUT 32 #define TEST_TIMEOUT 32
#define STREAMING_CALL_TEST_TIMEOUT 64
static const int kTestRetries = 3; static const int kTestRetries = 3;
extern const char *kCFStreamVarName; extern const char *kCFStreamVarName;
@ -749,7 +750,7 @@ static dispatch_once_t initGlobalInterceptorFactory;
GRPCUnaryProtoCall *call = calls[i]; GRPCUnaryProtoCall *call = calls[i];
[call start]; [call start];
} }
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:STREAMING_CALL_TEST_TIMEOUT handler:nil];
} }
- (void)concurrentRPCsWithErrors { - (void)concurrentRPCsWithErrors {
@ -934,7 +935,7 @@ static dispatch_once_t initGlobalInterceptorFactory;
[expectation fulfill]; [expectation fulfill];
}]; }];
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:STREAMING_CALL_TEST_TIMEOUT handler:nil];
} }
- (void)testServerStreamingRPC { - (void)testServerStreamingRPC {
@ -973,7 +974,7 @@ static dispatch_once_t initGlobalInterceptorFactory;
} }
}]; }];
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:STREAMING_CALL_TEST_TIMEOUT handler:nil];
} }
- (void)testPingPongRPC { - (void)testPingPongRPC {
@ -1020,7 +1021,7 @@ static dispatch_once_t initGlobalInterceptorFactory;
[expectation fulfill]; [expectation fulfill];
} }
}]; }];
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:STREAMING_CALL_TEST_TIMEOUT handler:nil];
} }
- (void)testPingPongRPCWithV2API { - (void)testPingPongRPCWithV2API {
@ -1074,7 +1075,7 @@ static dispatch_once_t initGlobalInterceptorFactory;
[call start]; [call start];
[call writeMessage:request]; [call writeMessage:request];
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:STREAMING_CALL_TEST_TIMEOUT handler:nil];
} }
- (void)testPingPongRPCWithFlowControl { - (void)testPingPongRPCWithFlowControl {
@ -1137,7 +1138,7 @@ static dispatch_once_t initGlobalInterceptorFactory;
[call receiveNextMessage]; [call receiveNextMessage];
[call writeMessage:request]; [call writeMessage:request];
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:STREAMING_CALL_TEST_TIMEOUT handler:nil];
} }
- (void)testEmptyStreamRPC { - (void)testEmptyStreamRPC {
@ -1466,7 +1467,7 @@ static dispatch_once_t initGlobalInterceptorFactory;
[call start]; [call start];
[call writeMessage:request]; [call writeMessage:request];
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:STREAMING_CALL_TEST_TIMEOUT handler:nil];
} }
- (void)testLoggingInterceptor { - (void)testLoggingInterceptor {
@ -1707,7 +1708,7 @@ static dispatch_once_t initGlobalInterceptorFactory;
[call receiveNextMessage]; [call receiveNextMessage];
[call writeMessage:request]; [call writeMessage:request];
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:STREAMING_CALL_TEST_TIMEOUT handler:nil];
XCTAssertEqual(startCount, 1); XCTAssertEqual(startCount, 1);
XCTAssertEqual(writeDataCount, 4); XCTAssertEqual(writeDataCount, 4);
XCTAssertEqual(finishCount, 1); XCTAssertEqual(finishCount, 1);
@ -1820,7 +1821,7 @@ static dispatch_once_t initGlobalInterceptorFactory;
[call receiveNextMessage]; [call receiveNextMessage];
[call writeMessage:request]; [call writeMessage:request];
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:STREAMING_CALL_TEST_TIMEOUT handler:nil];
XCTAssertEqual(startCount, 1); XCTAssertEqual(startCount, 1);
XCTAssertEqual(writeDataCount, 4); XCTAssertEqual(writeDataCount, 4);
XCTAssertEqual(finishCount, 1); XCTAssertEqual(finishCount, 1);
@ -2001,7 +2002,7 @@ static dispatch_once_t initGlobalInterceptorFactory;
[call receiveNextMessage]; [call receiveNextMessage];
[call writeMessage:request]; [call writeMessage:request];
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:STREAMING_CALL_TEST_TIMEOUT handler:nil];
XCTAssertEqual(startCount, 1); XCTAssertEqual(startCount, 1);
XCTAssertEqual(writeDataCount, 4); XCTAssertEqual(writeDataCount, 4);
XCTAssertEqual(finishCount, 1); XCTAssertEqual(finishCount, 1);

Loading…
Cancel
Save