summaryrefslogtreecommitdiff
path: root/js/test/Ice/exceptions/Client.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/test/Ice/exceptions/Client.js')
-rw-r--r--js/test/Ice/exceptions/Client.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/test/Ice/exceptions/Client.js b/js/test/Ice/exceptions/Client.js
index fce60ec4a84..a5e34edc27b 100644
--- a/js/test/Ice/exceptions/Client.js
+++ b/js/test/Ice/exceptions/Client.js
@@ -380,6 +380,30 @@
).then(
function()
{
+ // The above test can cause a close connection between the echo server and
+ // bidir server, we need to wait until the bidir server has reopen the
+ // connection with the echo server.
+ var reconnect = function(retries)
+ {
+ return thrower.ice_ping().catch(
+ (ex) =>
+ {
+ if(ex instanceof Ice.ObjectNotExistException && retries > 0)
+ {
+ return Ice.Promise.delay(20).then(() => reconnect(retries--));
+ }
+ else
+ {
+ throw ex;
+ }
+ });
+ };
+
+ return reconnect(5);
+ }
+ ).then(
+ function()
+ {
out.write("catching object not exist exception... ");
var id = Ice.stringToIdentity("does not exist");
var thrower2 = Test.ThrowerPrx.uncheckedCast(thrower.ice_identity(id));