From 2586af47f6680ac55c31b7f976234e68d7df1758 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 6 Jan 2016 16:43:21 -0800 Subject: [PATCH] misc/cgo/testcarchive,testcshared: deflake tests After a failure on the build dashboard I tested testcarchive test 2 and found that it failed an average of 1 in 475 runs on my laptop. With this change it ran over 50,000 times without failing. I bumped up the other iteration limits to correspond. Change-Id: I0155c68161a2c2a09ae25c91e9269f1e8702628d Reviewed-on: https://go-review.googlesource.com/18309 Run-TryBot: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- misc/cgo/testcarchive/main2.c | 2 +- misc/cgo/testcarchive/main3.c | 4 ++-- misc/cgo/testcarchive/main4.c | 4 ++-- misc/cgo/testcshared/main4.c | 2 +- misc/cgo/testcshared/main5.c | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/misc/cgo/testcarchive/main2.c b/misc/cgo/testcarchive/main2.c index 39e39c41a5c..372697760d9 100644 --- a/misc/cgo/testcarchive/main2.c +++ b/misc/cgo/testcarchive/main2.c @@ -152,7 +152,7 @@ int main(int argc, char** argv) { perror("sched_yield"); } i++; - if (i > 10000) { + if (i > 100000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); } diff --git a/misc/cgo/testcarchive/main3.c b/misc/cgo/testcarchive/main3.c index 2d3e5650db2..11046d087d7 100644 --- a/misc/cgo/testcarchive/main3.c +++ b/misc/cgo/testcarchive/main3.c @@ -68,7 +68,7 @@ int main(int argc, char** argv) { perror("sched_yield"); } i++; - if (i > 10000) { + if (i > 100000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); } @@ -142,7 +142,7 @@ int main(int argc, char** argv) { perror("sched_yield"); } i++; - if (i > 10000) { + if (i > 100000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); } diff --git a/misc/cgo/testcarchive/main4.c b/misc/cgo/testcarchive/main4.c index 3d7b736115d..2aaf09b7c19 100644 --- a/misc/cgo/testcarchive/main4.c +++ b/misc/cgo/testcarchive/main4.c @@ -78,7 +78,7 @@ static void* thread1(void* arg) { perror("sched_yield"); } i++; - if (i > 10000) { + if (i > 100000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); } @@ -133,7 +133,7 @@ static void* thread2(void* arg) { perror("sched_yield"); } i++; - if (i > 10000) { + if (i > 100000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); } diff --git a/misc/cgo/testcshared/main4.c b/misc/cgo/testcshared/main4.c index 803eb73bd93..fd7b5b31ed1 100644 --- a/misc/cgo/testcshared/main4.c +++ b/misc/cgo/testcshared/main4.c @@ -170,7 +170,7 @@ int main(int argc, char** argv) { perror("sched_yield"); } i++; - if (i > 10000) { + if (i > 100000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); } diff --git a/misc/cgo/testcshared/main5.c b/misc/cgo/testcshared/main5.c index 50ddb47c6b6..97a258f21a6 100644 --- a/misc/cgo/testcshared/main5.c +++ b/misc/cgo/testcshared/main5.c @@ -81,7 +81,7 @@ int main(int argc, char** argv) { perror("sched_yield"); } i++; - if (i > 10000) { + if (i > 100000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); } @@ -186,7 +186,7 @@ int main(int argc, char** argv) { perror("sched_yield"); } i++; - if (i > 10000) { + if (i > 100000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); }