diff options
author | 2016-06-30 13:43:23 -0700 | |
---|---|---|
committer | 2016-06-30 13:43:23 -0700 | |
commit | a5596db1a53723789d7c90c23d9cbfbb8207f949 (patch) | |
tree | 45efa15a49b77b7c3d317e88807a688900e55853 /src/objective-c/tests/InteropTests.m | |
parent | 8ecf5f5a21e6bed0ee47e195f11f3634aa0157e9 (diff) | |
parent | 75fe9ba8b32c7a5945b23b1cc53a05c6a14617bd (diff) |
Merge pull request #6378 from jcanizales/let-invalidate-channels
Add a maybe-temporary way for apps to clear the channel cache
Diffstat (limited to 'src/objective-c/tests/InteropTests.m')
-rw-r--r-- | src/objective-c/tests/InteropTests.m | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/objective-c/tests/InteropTests.m b/src/objective-c/tests/InteropTests.m index 392e7cb8d5..a503f02059 100644 --- a/src/objective-c/tests/InteropTests.m +++ b/src/objective-c/tests/InteropTests.m @@ -36,6 +36,7 @@ #include <grpc/status.h> #import <Cronet/Cronet.h> +#import <GRPCClient/GRPCCall+ChannelArg.h> #import <GRPCClient/GRPCCall+Tests.h> #import <GRPCClient/GRPCCall+Cronet.h> #import <ProtoRPC/ProtoRPC.h> @@ -337,4 +338,28 @@ static cronet_engine *cronetEngine = NULL; [self waitForExpectationsWithTimeout:8 handler:nil]; } +- (void)testRPCAfterClosingOpenConnections { + XCTAssertNotNil(self.class.host); + __weak XCTestExpectation *expectation = + [self expectationWithDescription:@"RPC after closing connection"]; + + RMTEmpty *request = [RMTEmpty message]; + + [_service emptyCallWithRequest:request handler:^(RMTEmpty *response, NSError *error) { + XCTAssertNil(error, @"First RPC finished with unexpected error: %@", error); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [GRPCCall closeOpenConnections]; +#pragma clang diagnostic pop + + [_service emptyCallWithRequest:request handler:^(RMTEmpty *response, NSError *error) { + XCTAssertNil(error, @"Second RPC finished with unexpected error: %@", error); + [expectation fulfill]; + }]; + }]; + + [self waitForExpectationsWithTimeout:4 handler:nil]; +} + @end |