From bc4df0efae2713e189847db7273234d4c8f518aa Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 22 Sep 2023 14:49:04 -0400 Subject: DRTVWR-589: Make pump&pipe fitness tests less timing sensitive. --- indra/test/io.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'indra/test/io.cpp') diff --git a/indra/test/io.cpp b/indra/test/io.cpp index 40243a8ad6..83e45661f8 100644 --- a/indra/test/io.cpp +++ b/indra/test/io.cpp @@ -1156,20 +1156,29 @@ namespace tut chain.clear(); // pump for a bit and make sure all 3 chains are running - pump_loop(mPump,0.1f); + for (int retry = 0; mPump->runningChains() < 3 && retry < 10; ++retry) + { + pump_loop(mPump, 0.1f); + } count = mPump->runningChains(); - // ensure_equals("client chain onboard", count, 3); commented out because it fails frequently - appears to be timing sensitive + ensure_equals("client chain onboard", count, 3); LL_DEBUGS() << "** request should have been sent." << LL_ENDL; // pump for long enough the the client socket closes, and the // server socket should not be closed yet. - pump_loop(mPump,0.2f); + for (int retry = 0; mPump->runningChains() == 3 && retry < 10; ++retry) + { + pump_loop(mPump, 0.1f); + } count = mPump->runningChains(); ensure_equals("client chain timed out ", count, 2); LL_DEBUGS() << "** client chain should be closed." << LL_ENDL; // At this point, the socket should be closed by the timeout - pump_loop(mPump,1.0f); + for (int retry = 0; mPump->runningChains() > 1 && retry < 10; ++retry) + { + pump_loop(mPump, 0.1f); + } count = mPump->runningChains(); ensure_equals("accepted socked close", count, 1); LL_DEBUGS() << "** Sleeper should have timed out.." << LL_ENDL; -- cgit v1.2.3 From 339107e4a3260c5ad564cb0325d94d166a27a8a5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 23 Sep 2023 09:28:16 -0400 Subject: DRTVWR-589: Further timing-proof pipe and pump fitness test. --- indra/test/io.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/test/io.cpp') diff --git a/indra/test/io.cpp b/indra/test/io.cpp index 83e45661f8..0a05986c00 100644 --- a/indra/test/io.cpp +++ b/indra/test/io.cpp @@ -45,6 +45,7 @@ #include "llcommon.h" #include "lluuid.h" #include "llinstantmessage.h" +#include "stringize.h" namespace tut { @@ -1170,8 +1171,11 @@ namespace tut { pump_loop(mPump, 0.1f); } + // We used to test for count == 2 here, but on a slow test machine it + // can happen that not just one but two chains close before we reach + // this point. count = mPump->runningChains(); - ensure_equals("client chain timed out ", count, 2); + ensure(stringize("client chain timed out: count ", count), count < 3); LL_DEBUGS() << "** client chain should be closed." << LL_ENDL; // At this point, the socket should be closed by the timeout -- cgit v1.2.3 From fa67efced89de1b7b432fca5a8d14f03b03ad88b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 26 Sep 2023 19:06:25 -0400 Subject: DRTVWR-589: Extend timeouts for timing-sensitive pump & pipe fitness. --- indra/test/io.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'indra/test/io.cpp') diff --git a/indra/test/io.cpp b/indra/test/io.cpp index 0a05986c00..25260c3f07 100644 --- a/indra/test/io.cpp +++ b/indra/test/io.cpp @@ -1117,6 +1117,7 @@ namespace tut template<> template<> void fitness_test_object::test<5>() { + const int retries = 100; // Set up the server LLPumpIO::chain_t chain; typedef LLCloneIOFactory sleeper_t; @@ -1130,9 +1131,12 @@ namespace tut chain.push_back(LLIOPipe::ptr_t(server)); mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS); // We need to tickle the pump a little to set up the listen() - pump_loop(mPump, 0.1f); + for (int retry = 0; mPump->runningChains() < 1 && retry < retries; ++retry) + { + pump_loop(mPump, 0.1f); + } U32 count = mPump->runningChains(); - ensure_equals("server chain onboard", count, 1); + ensure_equals("server chain 1 onboard", count, 1); LL_DEBUGS() << "** Server is up." << LL_ENDL; // Set up the client @@ -1141,9 +1145,12 @@ namespace tut bool connected = client->blockingConnect(server_host); ensure("Connected to server", connected); LL_DEBUGS() << "connected" << LL_ENDL; - pump_loop(mPump,0.1f); + for (int retry = 0; mPump->runningChains() < 2 && retry < retries; ++retry) + { + pump_loop(mPump,0.1f); + } count = mPump->runningChains(); - ensure_equals("server chain onboard", count, 2); + ensure_equals("server chain 2 onboard", count, 2); LL_DEBUGS() << "** Client is connected." << LL_ENDL; // We have connected, since the socket reader does not block, @@ -1157,7 +1164,7 @@ namespace tut chain.clear(); // pump for a bit and make sure all 3 chains are running - for (int retry = 0; mPump->runningChains() < 3 && retry < 10; ++retry) + for (int retry = 0; mPump->runningChains() < 3 && retry < retries; ++retry) { pump_loop(mPump, 0.1f); } @@ -1167,7 +1174,7 @@ namespace tut // pump for long enough the the client socket closes, and the // server socket should not be closed yet. - for (int retry = 0; mPump->runningChains() == 3 && retry < 10; ++retry) + for (int retry = 0; mPump->runningChains() == 3 && retry < retries; ++retry) { pump_loop(mPump, 0.1f); } @@ -1179,7 +1186,7 @@ namespace tut LL_DEBUGS() << "** client chain should be closed." << LL_ENDL; // At this point, the socket should be closed by the timeout - for (int retry = 0; mPump->runningChains() > 1 && retry < 10; ++retry) + for (int retry = 0; mPump->runningChains() > 1 && retry < retries; ++retry) { pump_loop(mPump, 0.1f); } -- cgit v1.2.3 From 285bb44d4cc7e47be474d431d65014ad4e41892b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 2 Oct 2023 14:20:13 -0400 Subject: DRTVWR-589: Give up on strongly timing-dependent LLIOPipe test. --- indra/test/io.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/test/io.cpp') diff --git a/indra/test/io.cpp b/indra/test/io.cpp index 25260c3f07..027db50693 100644 --- a/indra/test/io.cpp +++ b/indra/test/io.cpp @@ -1117,6 +1117,8 @@ namespace tut template<> template<> void fitness_test_object::test<5>() { + skip("Test is strongly timing dependent, " + "and on slow CI machines it fails way too often."); const int retries = 100; // Set up the server LLPumpIO::chain_t chain; -- cgit v1.2.3