Skip to content
Snippets Groups Projects
Commit e7aef6c4 authored by Muxi Yan's avatar Muxi Yan Committed by GitHub
Browse files

Merge pull request #10183 from muxi/backport-10042

Backport 10042: Use the right encoding overhead number in remote interop test with Cronet
parents 76557489 10112e50
No related branches found
No related tags found
No related merge requests found
...@@ -90,6 +90,9 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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"; ...@@ -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 @@ ...@@ -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"; ...@@ -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 @@ ...@@ -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"; ...@@ -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 @@ ...@@ -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"; ...@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment