]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo: decrease test failure timeouts
authorElias Naur <elias.naur@gmail.com>
Thu, 17 Nov 2016 12:52:00 +0000 (13:52 +0100)
committerIan Lance Taylor <iant@golang.org>
Thu, 17 Nov 2016 16:31:34 +0000 (16:31 +0000)
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 <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
misc/cgo/testcarchive/main2.c
misc/cgo/testcarchive/main3.c
misc/cgo/testcarchive/main4.c
misc/cgo/testcshared/main4.c
misc/cgo/testcshared/main5.c

index ea3798612984e9abdbc2a8c8b0d24f19db36a50f..774e014a1620967269a99eba962b175b69382c8f 100644 (file)
@@ -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);
                }
index bb7eeda032b4b7476422ccaf4c67e4fa04acac41..0a6c0d3f74e077b01fa7834d9f415f7acb1ea9d0 100644 (file)
@@ -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);
                }
index 39f7c309df58c0dec02e30e10f610369bb10b759..4fd55e753d58f7c77c53740105d7be95a0de412a 100644 (file)
@@ -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);
                }
index ffc4ecabad164698a5db0aaa47b696d780fc7e7f..355cdefb0174ec7670f0f5690c97f635759ed99b 100644 (file)
@@ -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);
                }
index 57c64a122eff1a3f75940d9bbebcc77f6a138548..1bc99101d7a38d6da94f33c14124a17ebd4ee16f 100644 (file)
@@ -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);
                }