Merge pull request #10042 from muxi/objc-test-fix

Use the right encoding overhead number in remote interop test with Cronet
pull/9734/merge
Muxi Yan 8 years ago committed by GitHub
commit d16df8fe12
  1. 9
      src/objective-c/tests/InteropTests.m
  2. 6
      src/objective-c/tests/InteropTestsLocalCleartext.m
  3. 6
      src/objective-c/tests/InteropTestsLocalSSL.m
  4. 6
      src/objective-c/tests/InteropTestsRemote.m
  5. 8
      src/objective-c/tests/InteropTestsRemoteWithCronet/InteropTestsRemoteWithCronet.m

@ -90,6 +90,9 @@
return nil; return nil;
} }
// This number indicates how many bytes of overhead does Protocol Buffers encoding add onto the
// message. The number varies as different message.proto is used on different servers. The actual
// number for each interop server is overridden in corresponding derived test classes.
- (int32_t)encodingOverhead { - (int32_t)encodingOverhead {
return 0; return 0;
} }
@ -169,8 +172,6 @@
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil];
} }
#ifndef GRPC_COMPILE_WITH_CRONET
// TODO (mxyan): Fix this test
- (void)testResponsesOverMaxSizeFailWithActionableMessage { - (void)testResponsesOverMaxSizeFailWithActionableMessage {
XCTAssertNotNil(self.class.host); XCTAssertNotNil(self.class.host);
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"ResponseOverMaxSize"]; __weak XCTestExpectation *expectation = [self expectationWithDescription:@"ResponseOverMaxSize"];
@ -191,7 +192,6 @@
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil];
} }
#endif
- (void)testResponsesOver4MBAreAcceptedIfOptedIn { - (void)testResponsesOver4MBAreAcceptedIfOptedIn {
XCTAssertNotNil(self.class.host); XCTAssertNotNil(self.class.host);
@ -327,8 +327,6 @@
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil];
} }
#ifndef GRPC_COMPILE_WITH_CRONET
// TODO(makdharma@): Fix this test
- (void)testEmptyStreamRPC { - (void)testEmptyStreamRPC {
XCTAssertNotNil(self.class.host); XCTAssertNotNil(self.class.host);
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"EmptyStream"]; __weak XCTestExpectation *expectation = [self expectationWithDescription:@"EmptyStream"];
@ -342,7 +340,6 @@
}]; }];
[self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil]; [self waitForExpectationsWithTimeout:TEST_TIMEOUT handler:nil];
} }
#endif
- (void)testCancelAfterBeginRPC { - (void)testCancelAfterBeginRPC {
XCTAssertNotNil(self.class.host); XCTAssertNotNil(self.class.host);

@ -37,6 +37,10 @@
static NSString * const kLocalCleartextHost = @"localhost:5050"; static NSString * const kLocalCleartextHost = @"localhost:5050";
// The Protocol Buffers encoding overhead of local interop server. Acquired
// by experiment. Adjust this when server's proto file changes.
static int32_t kLocalInteropServerOverhead = 10;
/** Tests in InteropTests.m, sending the RPCs to a local cleartext server. */ /** Tests in InteropTests.m, sending the RPCs to a local cleartext server. */
@interface InteropTestsLocalCleartext : InteropTests @interface InteropTestsLocalCleartext : InteropTests
@end @end
@ -48,7 +52,7 @@ static NSString * const kLocalCleartextHost = @"localhost:5050";
} }
- (int32_t)encodingOverhead { - (int32_t)encodingOverhead {
return 10; // bytes return kLocalInteropServerOverhead; // bytes
} }
- (void)setUp { - (void)setUp {

@ -37,6 +37,10 @@
static NSString * const kLocalSSLHost = @"localhost:5051"; static NSString * const kLocalSSLHost = @"localhost:5051";
// The Protocol Buffers encoding overhead of local interop server. Acquired
// by experiment. Adjust this when server's proto file changes.
static int32_t kLocalInteropServerOverhead = 10;
/** Tests in InteropTests.m, sending the RPCs to a local SSL server. */ /** Tests in InteropTests.m, sending the RPCs to a local SSL server. */
@interface InteropTestsLocalSSL : InteropTests @interface InteropTestsLocalSSL : InteropTests
@end @end
@ -48,7 +52,7 @@ static NSString * const kLocalSSLHost = @"localhost:5051";
} }
- (int32_t)encodingOverhead { - (int32_t)encodingOverhead {
return 10; // bytes return kLocalInteropServerOverhead; // bytes
} }
- (void)setUp { - (void)setUp {

@ -37,6 +37,10 @@
static NSString * const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com"; static NSString * const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com";
// The Protocol Buffers encoding overhead of remote interop server. Acquired
// by experiment. Adjust this when server's proto file changes.
static int32_t kRemoteInteropServerOverhead = 12;
/** Tests in InteropTests.m, sending the RPCs to a remote SSL server. */ /** Tests in InteropTests.m, sending the RPCs to a remote SSL server. */
@interface InteropTestsRemote : InteropTests @interface InteropTestsRemote : InteropTests
@end @end
@ -48,7 +52,7 @@ static NSString * const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com";
} }
- (int32_t)encodingOverhead { - (int32_t)encodingOverhead {
return 12; // bytes return kRemoteInteropServerOverhead; // bytes
} }
@end @end

@ -37,6 +37,10 @@
static NSString * const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com"; static NSString * const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com";
// The Protocol Buffers encoding overhead of remote interop server. Acquired
// by experiment. Adjust this when server's proto file changes.
static int32_t kRemoteInteropServerOverhead = 12;
/** Tests in InteropTests.m, sending the RPCs to a remote SSL server. */ /** Tests in InteropTests.m, sending the RPCs to a remote SSL server. */
@interface InteropTestsRemoteWithCronet : InteropTests @interface InteropTestsRemoteWithCronet : InteropTests
@end @end
@ -47,4 +51,8 @@ static NSString * const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com";
return kRemoteSSLHost; return kRemoteSSLHost;
} }
- (int32_t)encodingOverhead {
return kRemoteInteropServerOverhead; // bytes
}
@end @end

Loading…
Cancel
Save