From: Elias Naur Date: Thu, 17 Nov 2016 12:52:00 +0000 (+0100) Subject: misc/cgo: decrease test failure timeouts X-Git-Tag: go1.8beta1~117 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4ca3a8f7a807bba55e9db82b9aa8c43b1a186b8e;p=gostls13.git misc/cgo: decrease test failure timeouts CL 33239 changed the polling loops from using sched_yield to a sleep for 1/1000 of a second. The loop counters were not updated, so failing tests now take 100 seconds to complete. Lower the loop counts to 5 seconds instead. Change-Id: I7c9a343dacc8188603ecf7e58bd00b535cfc87f5 Reviewed-on: https://go-review.googlesource.com/33280 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/misc/cgo/testcarchive/main2.c b/misc/cgo/testcarchive/main2.c index ea37986129..774e014a16 100644 --- a/misc/cgo/testcarchive/main2.c +++ b/misc/cgo/testcarchive/main2.c @@ -166,7 +166,7 @@ int main(int argc, char** argv) { ts.tv_nsec = 1000000; nanosleep(&ts, NULL); i++; - if (i > 100000) { + if (i > 5000) { 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 bb7eeda032..0a6c0d3f74 100644 --- a/misc/cgo/testcarchive/main3.c +++ b/misc/cgo/testcarchive/main3.c @@ -70,7 +70,7 @@ int main(int argc, char** argv) { ts.tv_nsec = 1000000; nanosleep(&ts, NULL); i++; - if (i > 100000) { + if (i > 5000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); } @@ -144,7 +144,7 @@ int main(int argc, char** argv) { ts.tv_nsec = 1000000; nanosleep(&ts, NULL); i++; - if (i > 100000) { + if (i > 5000) { 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 39f7c309df..4fd55e753d 100644 --- a/misc/cgo/testcarchive/main4.c +++ b/misc/cgo/testcarchive/main4.c @@ -79,7 +79,7 @@ static void* thread1(void* arg __attribute__ ((unused))) { ts.tv_nsec = 1000000; nanosleep(&ts, NULL); i++; - if (i > 100000) { + if (i > 5000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); } @@ -136,7 +136,7 @@ static void* thread2(void* arg __attribute__ ((unused))) { ts.tv_nsec = 1000000; nanosleep(&ts, NULL); i++; - if (i > 100000) { + if (i > 5000) { 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 ffc4ecabad..355cdefb01 100644 --- a/misc/cgo/testcshared/main4.c +++ b/misc/cgo/testcshared/main4.c @@ -171,7 +171,7 @@ int main(int argc, char** argv) { ts.tv_nsec = 1000000; nanosleep(&ts, NULL); i++; - if (i > 100000) { + if (i > 5000) { 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 57c64a122e..1bc99101d7 100644 --- a/misc/cgo/testcshared/main5.c +++ b/misc/cgo/testcshared/main5.c @@ -83,7 +83,7 @@ int main(int argc, char** argv) { ts.tv_nsec = 1000000; nanosleep(&ts, NULL); i++; - if (i > 100000) { + if (i > 5000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); } @@ -188,7 +188,7 @@ int main(int argc, char** argv) { ts.tv_nsec = 1000000; nanosleep(&ts, NULL); i++; - if (i > 100000) { + if (i > 5000) { fprintf(stderr, "looping too long waiting for signal\n"); exit(EXIT_FAILURE); }