summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/tests')
-rw-r--r--indra/llcommon/tests/llprocess_test.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp
index 6103764f24..99186ed434 100644
--- a/indra/llcommon/tests/llprocess_test.cpp
+++ b/indra/llcommon/tests/llprocess_test.cpp
@@ -101,20 +101,26 @@ void yield(int seconds=1)
LLEventPumps::instance().obtain("mainloop").post(LLSD());
}
-void waitfor(LLProcess& proc)
+void waitfor(LLProcess& proc, int timeout=60)
{
- while (proc.isRunning())
+ int i = 0;
+ for ( ; i < timeout && proc.isRunning(); ++i)
{
yield();
}
+ tut::ensure(STRINGIZE("process took longer than " << timeout << " seconds to terminate"),
+ i < timeout);
}
-void waitfor(LLProcess::handle h, const std::string& desc)
+void waitfor(LLProcess::handle h, const std::string& desc, int timeout=60)
{
- while (LLProcess::isRunning(h, desc))
+ int i = 0;
+ for ( ; i < timeout && LLProcess::isRunning(h, desc); ++i)
{
yield();
}
+ tut::ensure(STRINGIZE("process took longer than " << timeout << " seconds to terminate"),
+ i < timeout);
}
/**