summaryrefslogtreecommitdiff
path: root/objective-c
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2019-08-22 16:14:09 +0200
committerBenoit Foucher <benoit@zeroc.com>2019-08-22 16:14:09 +0200
commitb0f6341f4ef05ee6f59b61bb18e7722e3f96347d (patch)
treeb6653af34c38222d0e1f4eed9d6674caadf5a0c0 /objective-c
parentWorkaround for AIX issue with SSL_write and EWOULDBLOCK (diff)
downloadice-b0f6341f4ef05ee6f59b61bb18e7722e3f96347d.tar.bz2
ice-b0f6341f4ef05ee6f59b61bb18e7722e3f96347d.tar.xz
ice-b0f6341f4ef05ee6f59b61bb18e7722e3f96347d.zip
Fixed Ice/timeout test to ensure the client doesn't hang in case of test failure
Diffstat (limited to 'objective-c')
-rw-r--r--objective-c/test/Ice/timeout/AllTests.m25
1 files changed, 20 insertions, 5 deletions
diff --git a/objective-c/test/Ice/timeout/AllTests.m b/objective-c/test/Ice/timeout/AllTests.m
index 64be1128004..9b45ec69efe 100644
--- a/objective-c/test/Ice/timeout/AllTests.m
+++ b/objective-c/test/Ice/timeout/AllTests.m
@@ -98,7 +98,7 @@ connectPrx(id<TestTimeoutTimeoutPrx> prx)
}
void
-timeoutAllTests(id<ICECommunicator> communicator)
+timeoutAllTestsWithController(id<ICECommunicator> communicator, id<TestTimeoutControllerPrx> controller)
{
NSString* sref = @"timeout:default -p 12010";
id<ICEObjectPrx> obj = [communicator stringToProxy:sref];
@@ -107,10 +107,6 @@ timeoutAllTests(id<ICECommunicator> communicator)
id<TestTimeoutTimeoutPrx> timeout = [TestTimeoutTimeoutPrx checkedCast:obj];
test(timeout);
- id<TestTimeoutControllerPrx> controller =
- [TestTimeoutControllerPrx checkedCast:[communicator stringToProxy:@"controller:default -p 12011"]];
- test(controller);
-
tprintf("testing connect timeout... ");
{
//
@@ -387,3 +383,22 @@ timeoutAllTests(id<ICECommunicator> communicator)
[controller shutdown];
}
+
+void
+timeoutAllTests(id<ICECommunicator> communicator)
+{
+ id<TestTimeoutControllerPrx> controller =
+ [TestTimeoutControllerPrx checkedCast:[communicator stringToProxy:@"controller:default -p 12011"]];
+ test(controller);
+ @try
+ {
+ timeoutAllTestsWithController(communicator, controller);
+ }
+ @catch(ICEException*)
+ {
+ // Ensure the adapter is not in the holding state when an unexpected exception occurs to prevent
+ // the test from hanging on exit in case a connection which disables timeouts is still opened.
+ [controller resumeAdapter];
+ @throw;
+ }
+}