diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-11-03 10:49:47 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-11-03 10:49:47 +0100 |
commit | 8859ae2dfb081c74bfc37f8066d0c3ea2207a45e (patch) | |
tree | 2a88692e7187f3a3f966b49b69f3e51c223c1fb1 | |
parent | support x86 RPM build on x64 platform (diff) | |
download | ice-8859ae2dfb081c74bfc37f8066d0c3ea2207a45e.tar.bz2 ice-8859ae2dfb081c74bfc37f8066d0c3ea2207a45e.tar.xz ice-8859ae2dfb081c74bfc37f8066d0c3ea2207a45e.zip |
Fixed ICE-5806: Freeze/evictor takes forever on OS X
-rwxr-xr-x | cpp/allTests.py | 4 | ||||
-rw-r--r-- | cpp/test/Freeze/evictor/Client.cpp | 14 | ||||
-rw-r--r-- | cpp/test/Freeze/evictor/Server.cpp | 11 | ||||
-rw-r--r-- | cpp/test/Freeze/evictor/db/DB_CONFIG | 1 | ||||
-rwxr-xr-x | java/allTests.py | 2 | ||||
-rw-r--r-- | java/test/src/main/java/test/Freeze/evictor/Client.java | 10 | ||||
-rw-r--r-- | java/test/src/main/java/test/Freeze/evictor/db/DB_CONFIG | 1 |
7 files changed, 35 insertions, 8 deletions
diff --git a/cpp/allTests.py b/cpp/allTests.py index cc8e86146ee..23ac33761d5 100755 --- a/cpp/allTests.py +++ b/cpp/allTests.py @@ -81,8 +81,8 @@ tests = [ ("IceBox/admin", ["core", "noipv6", "novc100", "nomingw", "nomx"]), ("Freeze/dbmap", ["once", "novc100", "nomingw"]), ("Freeze/complex", ["once", "novc100", "nomingw"]), - ("Freeze/evictor", ["core", "novc100", "nomingw"]), - ("Freeze/fileLock", ["core", "novc100", "nomingw"]), + ("Freeze/evictor", ["once", "novc100", "nomingw"]), + ("Freeze/fileLock", ["once", "novc100", "nomingw"]), ("IceStorm/single", ["service", "novc100", "noappverifier", "nomingw"]), # This test doesn't work with appverifier ("IceStorm/federation", ["service", "novc100", "nomingw"]), ("IceStorm/federation2", ["service", "novc100", "nomingw"]), diff --git a/cpp/test/Freeze/evictor/Client.cpp b/cpp/test/Freeze/evictor/Client.cpp index 2b80b7c211b..dd29b8ec990 100644 --- a/cpp/test/Freeze/evictor/Client.cpp +++ b/cpp/test/Freeze/evictor/Client.cpp @@ -366,10 +366,20 @@ public: run() { int transferOp = 0; - - for(int i = 0; i < 1000; i++) + IceUtil::Time now = IceUtil::Time::now(); + for(int i = 0; i < 500; i++) { // + // Limit the time this thread runs. We don't want the test + // to take too long on slow machines/VMs + // + if(IceUtil::Time::now() - now > IceUtil::Time::seconds(60)) + { + cerr << "warning: exiting transfer thread after one minute and " << i << " iterations" << endl; + break; + } + + // // Transfer 100 at random between two distinct accounts // Test::AccountPrx from = _accounts[IceUtilInternal::random(static_cast<int>(_accounts.size()))]; diff --git a/cpp/test/Freeze/evictor/Server.cpp b/cpp/test/Freeze/evictor/Server.cpp index 1793f915904..7d869931782 100644 --- a/cpp/test/Freeze/evictor/Server.cpp +++ b/cpp/test/Freeze/evictor/Server.cpp @@ -106,7 +106,16 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + + // + // Getting stack traces is expensive and this test creates a lot + // of DeadlockException. + // + initData.properties->setProperty("Ice.PrintStackTraces", "0"); + + communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator, envName); } catch(const Ice::Exception& ex) diff --git a/cpp/test/Freeze/evictor/db/DB_CONFIG b/cpp/test/Freeze/evictor/db/DB_CONFIG index b6d05535741..b275b2b2a26 100644 --- a/cpp/test/Freeze/evictor/db/DB_CONFIG +++ b/cpp/test/Freeze/evictor/db/DB_CONFIG @@ -1,2 +1,3 @@ set_flags DB_TXN_NOSYNC + diff --git a/java/allTests.py b/java/allTests.py index 701f4554fd9..f17c9eadd4c 100755 --- a/java/allTests.py +++ b/java/allTests.py @@ -78,7 +78,7 @@ tests = [ ("src/main/java/test/IceBox/configuration", ["core", "noipv6", "nomx"]), ("src/main/java/test/Freeze/dbmap", ["once"]), ("src/main/java/test/Freeze/complex", ["once"]), - ("src/main/java/test/Freeze/evictor", ["core"]), + ("src/main/java/test/Freeze/evictor", ["once"]), ("src/main/java/test/Freeze/fileLock", ["once"]), ("src/main/java/test/Glacier2/router", ["service"]), ("src/main/java/test/Glacier2/sessionHelper", ["service", "nossl", "nows", "noipv6"]), diff --git a/java/test/src/main/java/test/Freeze/evictor/Client.java b/java/test/src/main/java/test/Freeze/evictor/Client.java index a5e649fdf48..5af5b1f9fbb 100644 --- a/java/test/src/main/java/test/Freeze/evictor/Client.java +++ b/java/test/src/main/java/test/Freeze/evictor/Client.java @@ -334,9 +334,15 @@ public class Client extends test.Util.Application run() { int transferOp = 0; - - for(int i = 0; i < 1000; i++) + long now = System.currentTimeMillis(); + for(int i = 0; i < 500; i++) { + if((System.currentTimeMillis() - now) > (60 * 1000)) + { + System.err.println("warning: exiting transfer thread after one minute and " + i + " iterations"); + break; + } + // // Transfer 100 at random between two distinct accounts // diff --git a/java/test/src/main/java/test/Freeze/evictor/db/DB_CONFIG b/java/test/src/main/java/test/Freeze/evictor/db/DB_CONFIG new file mode 100644 index 00000000000..b30bfd2ab9c --- /dev/null +++ b/java/test/src/main/java/test/Freeze/evictor/db/DB_CONFIG @@ -0,0 +1 @@ +set_flags DB_TXN_NOSYNC |