summaryrefslogtreecommitdiff
path: root/js/test/Ice/timeout/Client.js
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 /js/test/Ice/timeout/Client.js
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 'js/test/Ice/timeout/Client.js')
-rw-r--r--js/test/Ice/timeout/Client.js22
1 files changed, 18 insertions, 4 deletions
diff --git a/js/test/Ice/timeout/Client.js b/js/test/Ice/timeout/Client.js
index 295405aa809..74b1a89e844 100644
--- a/js/test/Ice/timeout/Client.js
+++ b/js/test/Ice/timeout/Client.js
@@ -13,6 +13,24 @@
{
async allTests()
{
+ const controller = Test.ControllerPrx.uncheckedCast(
+ this.communicator().stringToProxy("controller:" + this.getTestEndpoint(1)));
+ test(controller !== null);
+ try
+ {
+ await this.allTestsWithController(controller);
+ }
+ catch(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;
+ }
+ }
+
+ async allTestsWithController(controller)
+ {
async function connect(prx)
{
let nRetry = 10;
@@ -51,10 +69,6 @@
const timeout = await Test.TimeoutPrx.checkedCast(obj);
test(timeout !== null);
- const controller = Test.ControllerPrx.uncheckedCast(
- communicator.stringToProxy("controller:" + this.getTestEndpoint(1)));
- test(controller !== null);
-
out.write("testing connect timeout... ");
{
const to = Test.TimeoutPrx.uncheckedCast(obj.ice_timeout(100 * mult));