Commit 2586af47 authored by Ian Lance Taylor's avatar Ian Lance Taylor

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 <iant@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 24ef1d60
...@@ -152,7 +152,7 @@ int main(int argc, char** argv) { ...@@ -152,7 +152,7 @@ int main(int argc, char** argv) {
perror("sched_yield"); perror("sched_yield");
} }
i++; i++;
if (i > 10000) { if (i > 100000) {
fprintf(stderr, "looping too long waiting for signal\n"); fprintf(stderr, "looping too long waiting for signal\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
...@@ -68,7 +68,7 @@ int main(int argc, char** argv) { ...@@ -68,7 +68,7 @@ int main(int argc, char** argv) {
perror("sched_yield"); perror("sched_yield");
} }
i++; i++;
if (i > 10000) { if (i > 100000) {
fprintf(stderr, "looping too long waiting for signal\n"); fprintf(stderr, "looping too long waiting for signal\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -142,7 +142,7 @@ int main(int argc, char** argv) { ...@@ -142,7 +142,7 @@ int main(int argc, char** argv) {
perror("sched_yield"); perror("sched_yield");
} }
i++; i++;
if (i > 10000) { if (i > 100000) {
fprintf(stderr, "looping too long waiting for signal\n"); fprintf(stderr, "looping too long waiting for signal\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
...@@ -78,7 +78,7 @@ static void* thread1(void* arg) { ...@@ -78,7 +78,7 @@ static void* thread1(void* arg) {
perror("sched_yield"); perror("sched_yield");
} }
i++; i++;
if (i > 10000) { if (i > 100000) {
fprintf(stderr, "looping too long waiting for signal\n"); fprintf(stderr, "looping too long waiting for signal\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -133,7 +133,7 @@ static void* thread2(void* arg) { ...@@ -133,7 +133,7 @@ static void* thread2(void* arg) {
perror("sched_yield"); perror("sched_yield");
} }
i++; i++;
if (i > 10000) { if (i > 100000) {
fprintf(stderr, "looping too long waiting for signal\n"); fprintf(stderr, "looping too long waiting for signal\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
...@@ -170,7 +170,7 @@ int main(int argc, char** argv) { ...@@ -170,7 +170,7 @@ int main(int argc, char** argv) {
perror("sched_yield"); perror("sched_yield");
} }
i++; i++;
if (i > 10000) { if (i > 100000) {
fprintf(stderr, "looping too long waiting for signal\n"); fprintf(stderr, "looping too long waiting for signal\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
...@@ -81,7 +81,7 @@ int main(int argc, char** argv) { ...@@ -81,7 +81,7 @@ int main(int argc, char** argv) {
perror("sched_yield"); perror("sched_yield");
} }
i++; i++;
if (i > 10000) { if (i > 100000) {
fprintf(stderr, "looping too long waiting for signal\n"); fprintf(stderr, "looping too long waiting for signal\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -186,7 +186,7 @@ int main(int argc, char** argv) { ...@@ -186,7 +186,7 @@ int main(int argc, char** argv) {
perror("sched_yield"); perror("sched_yield");
} }
i++; i++;
if (i > 10000) { if (i > 100000) {
fprintf(stderr, "looping too long waiting for signal\n"); fprintf(stderr, "looping too long waiting for signal\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment