summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-09-18 20:06:50 +0200
committerJose <jose@zeroc.com>2018-09-18 20:06:50 +0200
commit104d5a09e2a1335b451fed020c439af629e45b27 (patch)
treed29659a8ef6c292b7eeac9a59dab0229448c9833 /js
parentImprove Glacier2 category randomness distribution (diff)
downloadice-104d5a09e2a1335b451fed020c439af629e45b27.tar.bz2
ice-104d5a09e2a1335b451fed020c439af629e45b27.tar.xz
ice-104d5a09e2a1335b451fed020c439af629e45b27.zip
JavaScript Ice/timeout hang
See #200
Diffstat (limited to 'js')
-rw-r--r--js/test/Ice/timeout/Client.js77
1 files changed, 52 insertions, 25 deletions
diff --git a/js/test/Ice/timeout/Client.js b/js/test/Ice/timeout/Client.js
index 3ec1a54d59c..ae5d5859cb1 100644
--- a/js/test/Ice/timeout/Client.js
+++ b/js/test/Ice/timeout/Client.js
@@ -73,7 +73,10 @@
{
test(ex instanceof Ice.ConnectTimeoutException, ex);
}
- await controller.resumeAdapter();
+ finally
+ {
+ await controller.resumeAdapter();
+ }
await timeout.op(); // Ensure adapter is active.
}
@@ -107,7 +110,10 @@
{
test(ex instanceof Ice.TimeoutException, ex);
}
- await controller.resumeAdapter();
+ finally
+ {
+ await controller.resumeAdapter();
+ }
await timeout.op(); // Ensure adapter is active.
}
@@ -169,27 +175,29 @@
try
{
connection.getInfo(); // getInfo() doesn't throw in the closing state
+ while(true)
+ {
+ try
+ {
+ connection.getInfo();
+ await Ice.Promise.delay(10);
+ }
+ catch(ex)
+ {
+ test(ex instanceof Ice.ConnectionManuallyClosedException, ex); // Expected
+ test(ex.graceful);
+ break;
+ }
+ }
}
catch(ex)
{
test(false, ex);
}
-
- while(true)
+ finally
{
- try
- {
- connection.getInfo();
- await Ice.Promise.delay(10);
- }
- catch(ex)
- {
- test(ex instanceof Ice.ConnectionManuallyClosedException, ex); // Expected
- test(ex.graceful);
- break;
- }
+ await controller.resumeAdapter();
}
- await controller.resumeAdapter();
await timeout.op();
}
out.writeLine("ok");
@@ -229,8 +237,10 @@
{
test(ex instanceof Ice.TimeoutException, ex);
}
-
- await controller.resumeAdapter();
+ finally
+ {
+ await controller.resumeAdapter();
+ }
await timeout.op();
//
// Calling ice_timeout() should have no effect.
@@ -247,7 +257,10 @@
{
test(ex instanceof Ice.TimeoutException, ex);
}
- await controller.resumeAdapter();
+ finally
+ {
+ await controller.resumeAdapter();
+ }
await timeout.op();
await comm.destroy();
}
@@ -282,8 +295,10 @@
{
test(ex instanceof Ice.ConnectTimeoutException, ex);
}
-
- await controller.resumeAdapter();
+ finally
+ {
+ await controller.resumeAdapter();
+ }
await timeout.op();
await controller.holdAdapter(-1);
@@ -301,7 +316,10 @@
{
test(ex instanceof Ice.ConnectTimeoutException, ex);
}
- await controller.resumeAdapter();
+ finally
+ {
+ await controller.resumeAdapter();
+ }
await timeout.op(); // Ensure adapter is active
//
@@ -320,7 +338,10 @@
{
test(ex instanceof Ice.TimeoutException, ex);
}
- await controller.resumeAdapter();
+ finally
+ {
+ await controller.resumeAdapter();
+ }
await timeout.op();
await comm.destroy();
}
@@ -342,8 +363,14 @@
const start = Date.now();
await comm.destroy();
const end = Date.now();
- test(end - start < 1000);
- await controller.resumeAdapter();
+ try
+ {
+ test(end - start < 2000);
+ }
+ finally
+ {
+ await controller.resumeAdapter();
+ }
out.writeLine("ok");
await controller.shutdown();
}