summaryrefslogtreecommitdiffstats
path: root/src/usr/testcore/lib
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2011-10-04 15:39:23 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-10-19 16:53:45 -0500
commitbcf95761edd1bb817be09d1bbf1106f17bab9059 (patch)
treec8b51b0c907bf6e3b760a5e65ba25dacda3a3790 /src/usr/testcore/lib
parent3977f21e31ae5dccdbf0dbf792dd978c33568726 (diff)
downloadtalos-hostboot-bcf95761edd1bb817be09d1bbf1106f17bab9059.tar.gz
talos-hostboot-bcf95761edd1bb817be09d1bbf1106f17bab9059.zip
Reduce sleep times in test cases.
Change-Id: I262532cb368ed4d2d5c718e00783a73eb2790855 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/440 Tested-by: Jenkins Server Reviewed-by: MATTHEW S. BARTH <msbarth@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Diffstat (limited to 'src/usr/testcore/lib')
-rw-r--r--src/usr/testcore/lib/synctest.H7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/usr/testcore/lib/synctest.H b/src/usr/testcore/lib/synctest.H
index 80b462c5d..e8b0ef1e0 100644
--- a/src/usr/testcore/lib/synctest.H
+++ b/src/usr/testcore/lib/synctest.H
@@ -33,6 +33,11 @@
#include <sys/task.h>
#include <sys/time.h>
+#include <kernel/timemgr.H>
+
+#define NS_PER_SEC (1000000ull)
+#define TEN_CTX_SWITCHES ((NS_PER_SEC/TimeManager::TIMESLICE_PER_SEC)*10)
+
class SyncTest: public CxxTest::TestSuite
{
public:
@@ -61,7 +66,7 @@ class SyncTest: public CxxTest::TestSuite
mutex_lock(&mutex);
task_create(func2, this);
task_create(func2, this);
- nanosleep(1,0);
+ nanosleep(0,TEN_CTX_SWITCHES);
mutex_unlock(&mutex);
barrier_wait(&barrier);
TS_TRACE("ALL THREADS ENDED");
OpenPOWER on IntegriCloud