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') 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