diff options
author | Jorge Canizales <jcanizales@google.com> | 2016-04-29 19:58:52 -0700 |
---|---|---|
committer | Jorge Canizales <jcanizales@google.com> | 2016-04-29 19:58:52 -0700 |
commit | fa70dacf95b93486b7dfe0c21ada90d75a5d5bcd (patch) | |
tree | f7d4513a95a192939bfbd76ef0f6e5d52def1c41 /src/objective-c/tests/InteropTests.m | |
parent | 454432542a6cc6145621003ecd8303c82a4e2b7b (diff) |
Smoke test that things still work after “closeOpenConnections”
Diffstat (limited to 'src/objective-c/tests/InteropTests.m')
-rw-r--r-- | src/objective-c/tests/InteropTests.m | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/objective-c/tests/InteropTests.m b/src/objective-c/tests/InteropTests.m index 26877b1ae8..379271a312 100644 --- a/src/objective-c/tests/InteropTests.m +++ b/src/objective-c/tests/InteropTests.m @@ -35,6 +35,7 @@ #include <grpc/status.h> +#import <GRPCClient/GRPCCall+ChannelArg.h> #import <GRPCClient/GRPCCall+Tests.h> #import <ProtoRPC/ProtoRPC.h> #import <RemoteTest/Empty.pbobjc.h> @@ -312,4 +313,25 @@ [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); + + [GRPCCall closeOpenConnections]; + + [_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 |