summaryrefslogtreecommitdiff
path: root/java-compat
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-compat
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-compat')
-rw-r--r--java-compat/test/src/main/java/test/Ice/timeout/AllTests.java24
1 files changed, 20 insertions, 4 deletions
diff --git a/java-compat/test/src/main/java/test/Ice/timeout/AllTests.java b/java-compat/test/src/main/java/test/Ice/timeout/AllTests.java
index eb0abb6b9e1..569281cabf5 100644
--- a/java-compat/test/src/main/java/test/Ice/timeout/AllTests.java
+++ b/java-compat/test/src/main/java/test/Ice/timeout/AllTests.java
@@ -151,6 +151,26 @@ public class AllTests
public static void
allTests(test.TestHelper helper)
{
+ ControllerPrx controller = ControllerPrxHelper.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)
+ {
Ice.Communicator communicator = helper.communicator();
PrintWriter out = helper.getWriter();
@@ -168,10 +188,6 @@ public class AllTests
TimeoutPrx timeout = TimeoutPrxHelper.checkedCast(obj);
test(timeout != null);
- ControllerPrx controller = ControllerPrxHelper.checkedCast(
- communicator.stringToProxy("controller:" + helper.getTestEndpoint(1)));
- test(controller != null);
-
out.print("testing connect timeout... ");
out.flush();
{