diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-03-13 15:48:48 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-03-13 15:48:48 +0100 |
commit | 6100dbec3982b80c6fe88cff15be24f44e5fa1ad (patch) | |
tree | caea870ac8d428e0e1948e78733f476ae643a6f2 /java | |
parent | minor formatting tweaks to protobuf demo README (diff) | |
download | ice-6100dbec3982b80c6fe88cff15be24f44e5fa1ad.tar.bz2 ice-6100dbec3982b80c6fe88cff15be24f44e5fa1ad.tar.xz ice-6100dbec3982b80c6fe88cff15be24f44e5fa1ad.zip |
Fixed for bug 3830, 3866, 3857 - CHANGES fixes, test/Ice/timeout and udp failures, also committed minor fixes to other tests to better handle slow machines
Diffstat (limited to 'java')
-rw-r--r-- | java/test/Ice/background/AllTests.java | 4 | ||||
-rw-r--r-- | java/test/Ice/location/AllTests.java | 7 | ||||
-rw-r--r-- | java/test/Ice/timeout/AllTests.java | 2 | ||||
-rw-r--r-- | java/test/Ice/udp/AllTests.java | 24 |
4 files changed, 26 insertions, 11 deletions
diff --git a/java/test/Ice/background/AllTests.java b/java/test/Ice/background/AllTests.java index 737f792c8d0..2c58e1a2ab6 100644 --- a/java/test/Ice/background/AllTests.java +++ b/java/test/Ice/background/AllTests.java @@ -229,13 +229,13 @@ public class AllTests public static Test.BackgroundPrx allTests(Ice.Communicator communicator, java.io.PrintStream out) { - String sref = "background:default -p 12010 -t 10000"; + String sref = "background:default -p 12010 -t 20000"; Ice.ObjectPrx obj = communicator.stringToProxy(sref); test(obj != null); BackgroundPrx background = BackgroundPrxHelper.uncheckedCast(obj); - sref = "backgroundController:tcp -p 12011 -t 10000"; + sref = "backgroundController:tcp -p 12011 -t 20000"; obj = communicator.stringToProxy(sref); test(obj != null); diff --git a/java/test/Ice/location/AllTests.java b/java/test/Ice/location/AllTests.java index df1544e9038..fe1dd53a7d7 100644 --- a/java/test/Ice/location/AllTests.java +++ b/java/test/Ice/location/AllTests.java @@ -364,7 +364,8 @@ public class AllTests catch(Ice.NotRegisteredException ex) { } - test(locator.getRequestCount() > count && locator.getRequestCount() < count + 999); + // We need to take into account the retries. + test(locator.getRequestCount() > count && locator.getRequestCount() < count + 1999); if(locator.getRequestCount() > count + 800) { System.out.print("queuing = " + (locator.getRequestCount() - count)); @@ -605,8 +606,8 @@ public class AllTests { } registry.addObject(communicator.stringToProxy("test3:tcp")); - ic.stringToProxy("test@TestAdapter5").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout. - ic.stringToProxy("test3").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout. + ic.stringToProxy("test@TestAdapter5").ice_locatorCacheTimeout(10).ice_ping(); // 10s timeout. + ic.stringToProxy("test3").ice_locatorCacheTimeout(10).ice_ping(); // 10s timeout. test(count == locator.getRequestCount()); try { diff --git a/java/test/Ice/timeout/AllTests.java b/java/test/Ice/timeout/AllTests.java index 73cf9dffb5c..1f827eb9e47 100644 --- a/java/test/Ice/timeout/AllTests.java +++ b/java/test/Ice/timeout/AllTests.java @@ -190,7 +190,7 @@ public class AllTests // Expect success. // timeout.op(); // Ensure adapter is active. - TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(1000)); + TimeoutPrx to = TimeoutPrxHelper.uncheckedCast(obj.ice_timeout(2000)); to.holdAdapter(500); to.ice_getConnection().close(true); // Force a reconnect. try diff --git a/java/test/Ice/udp/AllTests.java b/java/test/Ice/udp/AllTests.java index e374478f2ea..53f10f5a633 100644 --- a/java/test/Ice/udp/AllTests.java +++ b/java/test/Ice/udp/AllTests.java @@ -76,11 +76,25 @@ public class AllTests Ice.ObjectPrx base = communicator.stringToProxy("test:udp -p 12010").ice_datagram(); Test.TestIntfPrx obj = Test.TestIntfPrxHelper.uncheckedCast(base); - replyI.reset(); - obj.ping(reply); - obj.ping(reply); - obj.ping(reply); - boolean ret = replyI.waitReply(3, 2000); + int nRetry = 5; + boolean ret = false; + while(nRetry-- > 0) + { + replyI.reset(); + obj.ping(reply); + obj.ping(reply); + obj.ping(reply); + ret = replyI.waitReply(3, 2000); + if(ret) + { + break; // Success + } + + // If the 3 datagrams were not received within the 2 seconds, we try again to + // receive 3 new datagrams using a new object. We give up after 5 retries. + replyI = new PingReplyI(); + reply =(Test.PingReplyPrx)Test.PingReplyPrxHelper.uncheckedCast(adapter.addWithUUID(replyI)).ice_datagram(); + } test(ret == true); if(communicator.getProperties().getPropertyAsInt("Ice.Override.Compress") == 0) |