summaryrefslogtreecommitdiff
path: root/java
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 /java
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 'java')
-rw-r--r--java/test/src/main/java/test/Ice/timeout/AllTests.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/java/test/src/main/java/test/Ice/timeout/AllTests.java b/java/test/src/main/java/test/Ice/timeout/AllTests.java
index 8b5e2fbe11f..80f99bc89c8 100644
--- a/java/test/src/main/java/test/Ice/timeout/AllTests.java
+++ b/java/test/src/main/java/test/Ice/timeout/AllTests.java
@@ -73,6 +73,25 @@ public class AllTests
public static void allTests(test.TestHelper helper)
{
+ ControllerPrx controller = ControllerPrx.checkedCast(
+ helper.communicator().stringToProxy("controller:" + helper.getTestEndpoint(1)));
+ test(controller != null);
+
+ try
+ {
+ allTestsWithController(helper, controller);
+ }
+ catch(Exception ex)
+ {
+ // 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 ex;
+ }
+ }
+
+ public static void allTestsWithController(test.TestHelper helper, ControllerPrx controller)
+ {
com.zeroc.Ice.Communicator communicator = helper.communicator();
PrintWriter out = helper.getWriter();
@@ -90,10 +109,6 @@ public class AllTests
TimeoutPrx timeout = TimeoutPrx.checkedCast(obj);
test(timeout != null);
- ControllerPrx controller = ControllerPrx.checkedCast(
- communicator.stringToProxy("controller:" + helper.getTestEndpoint(1)));
- test(controller != null);
-
out.print("testing connect timeout... ");
out.flush();
{