[compiler-rt] r265666 - [tsan] Remove long sleeps from fork tests

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 05:10:28 PDT 2016


Author: kuba.brecka
Date: Thu Apr  7 07:10:28 2016
New Revision: 265666

URL: http://llvm.org/viewvc/llvm-project?rev=265666&view=rev
Log:
[tsan] Remove long sleeps from fork tests

On one of our testing machines, we're running the tests under heavy load, and especially in the fork-based TSan tests, we're seeing timeouts when a test uses sleep(10), assuming that calling fork() on another thread will finish sooner than that. This patch removes a timeout and makes another one longer.

Differential Revision: http://reviews.llvm.org/D18476


Modified:
    compiler-rt/trunk/test/tsan/fork_deadlock.cc
    compiler-rt/trunk/test/tsan/fork_multithreaded.cc

Modified: compiler-rt/trunk/test/tsan/fork_deadlock.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fork_deadlock.cc?rev=265666&r1=265665&r2=265666&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/fork_deadlock.cc (original)
+++ compiler-rt/trunk/test/tsan/fork_deadlock.cc Thu Apr  7 07:10:28 2016
@@ -12,18 +12,10 @@ static void *incrementer(void *p) {
   return 0;
 }
 
-static void *watchdog(void *p) {
-  sleep(100);  // is not intended to exit
-  fprintf(stderr, "timed out after 100 seconds\n");
-  exit(1);
-  return 0;
-}
-
 int main() {
   barrier_init(&barrier, 2);
-  pthread_t th1, th2;
+  pthread_t th1;
   pthread_create(&th1, 0, incrementer, 0);
-  pthread_create(&th2, 0, watchdog, 0);
   for (int i = 0; i < 10; i++) {
     switch (fork()) {
     default:  // parent

Modified: compiler-rt/trunk/test/tsan/fork_multithreaded.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/fork_multithreaded.cc?rev=265666&r1=265665&r2=265666&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/fork_multithreaded.cc (original)
+++ compiler-rt/trunk/test/tsan/fork_multithreaded.cc Thu Apr  7 07:10:28 2016
@@ -6,7 +6,7 @@
 #include <sys/wait.h>
 
 static void *sleeper(void *p) {
-  sleep(10);  // not intended to exit during test
+  sleep(1000);  // not intended to exit during test
   return 0;
 }
 




More information about the llvm-commits mailing list