diff --git a/tests/pthread/exit.c b/tests/pthread/exit.c index 14e1daee1a..5538a0f593 100644 --- a/tests/pthread/exit.c +++ b/tests/pthread/exit.c @@ -9,7 +9,7 @@ void *routine(void *arg) { assert(arg == NULL); - usleep(100); + usleep(100000); puts("Thread succeeded"); diff --git a/tests/pthread/extjoin.c b/tests/pthread/extjoin.c index 8f1737587d..da19101075 100644 --- a/tests/pthread/extjoin.c +++ b/tests/pthread/extjoin.c @@ -15,7 +15,7 @@ struct arg2 { void *routine1(void *arg) { assert(arg == NULL); puts("Thread 1 spawned, waiting 1s."); - usleep(100); + usleep(100000); puts("Thread 1 finished."); return strdup("message from thread 1"); } diff --git a/tests/pthread/main.c b/tests/pthread/main.c index acf51adb48..186e306c2b 100644 --- a/tests/pthread/main.c +++ b/tests/pthread/main.c @@ -20,7 +20,7 @@ int main(void) { int status; puts("Start, sleeping 1 second"); - usleep(100); + usleep(100000); pthread_t thread; void *arg = NULL; if ((status = pthread_create(&thread, NULL, thread_main, arg)) != 0) { diff --git a/tests/ptrace.c b/tests/ptrace.c index 66592f7ed2..23d3c833f1 100644 --- a/tests/ptrace.c +++ b/tests/ptrace.c @@ -26,7 +26,7 @@ int main() { if (pid == 0) { // Test behavior on Redox when TRACEME hasn't been activated // before waitpid is invoked! - usleep(100); + usleep(100000); int result = ptrace(PTRACE_TRACEME, 0, NULL, NULL); ERROR_IF(ptrace, result, == -1); diff --git a/tests/signals/killpg-child.c b/tests/signals/killpg-child.c index c6cfbe1851..d1ef669ca1 100644 --- a/tests/signals/killpg-child.c +++ b/tests/signals/killpg-child.c @@ -37,7 +37,7 @@ int killpg_test2(int signum) int i; sigignore(signum); - usleep(100); + usleep(100000); child_pgid = getpgid(child_pid); ERROR_IF(getpgid, child_pgid, == -1); diff --git a/tests/signals/pthread_kill-self.c b/tests/signals/pthread_kill-self.c index e53db627cf..dcc42b85c2 100644 --- a/tests/signals/pthread_kill-self.c +++ b/tests/signals/pthread_kill-self.c @@ -38,7 +38,7 @@ void *a_thread_func( void *arg) sem1=INMAIN; while(sem1==INMAIN) - usleep(100); + usleep(100000); // sleep(50); @@ -61,16 +61,16 @@ int pthread_kill_test1(int signum) ERROR_IF(pthread_create, status, != 0); while(sem1==INTHREAD) - usleep(100); + usleep(100000); status = pthread_kill(new_th, signum); ERROR_IF(pthread_kill, status, != 0); - usleep(200); + usleep(100000); sem1=INTHREAD; while(handler_called==0) - usleep(100); + usleep(100000); ERROR_IF(pthread_kill, handler_called, == -1); ERROR_IF(pthread_kill, handler_called, == 0); diff --git a/tests/signals/sigpause-error.c b/tests/signals/sigpause-error.c index 2a33a608c0..47d9e38388 100644 --- a/tests/signals/sigpause-error.c +++ b/tests/signals/sigpause-error.c @@ -71,14 +71,14 @@ int sigpause_error(int signum){ status = pthread_create(&new_th, NULL, d_thread_func, (void *)&signum); ERROR_IF(pthread_create, status, != 0); - usleep(100); + usleep(100000); status = pthread_kill(new_th, signum); ERROR_IF(pthread_kill, status, != 0); sem = INTHREAD; while (sem == INTHREAD) - usleep(100); + usleep(100000); if(result == 2) { exit(EXIT_FAILURE); diff --git a/tests/signals/sigpause-pause.c b/tests/signals/sigpause-pause.c index 85ec96f3d5..e2a24c763e 100644 --- a/tests/signals/sigpause-pause.c +++ b/tests/signals/sigpause-pause.c @@ -45,12 +45,12 @@ int sigpause_basic(int signum) status = pthread_create(&new_th, NULL, a_thread_func, (void *)&signum); ERROR_IF(pthread_create, status, != 0); - usleep(100); + usleep(100000); status = pthread_kill(new_th, signum); ERROR_IF(pthread_kill, status, != 0); - usleep(100); + usleep(100000); if (handler_called != 1){ prinft("handler wasn't called\n"); diff --git a/tests/signals/sigpause-revert.c b/tests/signals/sigpause-revert.c index ba8f1d8cdd..7e5fe8a3ab 100644 --- a/tests/signals/sigpause-revert.c +++ b/tests/signals/sigpause-revert.c @@ -77,7 +77,7 @@ int sigpause_revert(int signum) { exit(EXIT_FAILURE); } - usleep(100); + usleep(100000); if((status = pthread_kill(new_th, signum)) != 0) { diff --git a/tests/signals/sigpause-suspend.c b/tests/signals/sigpause-suspend.c index ab67c8380d..ed2ab1d2a5 100644 --- a/tests/signals/sigpause-suspend.c +++ b/tests/signals/sigpause-suspend.c @@ -55,7 +55,7 @@ int sigpause_suspend(int signum) perror("failed to create thread"); return EXIT_FAILURE; } - usleep(100); + usleep(100000); assert(!atomic_load(&completed)); if ((status = pthread_kill(new_th, signum)) != 0) { diff --git a/tests/unistd/sleep.c b/tests/unistd/sleep.c index 4ffb8f67d8..92b254e79f 100644 --- a/tests/unistd/sleep.c +++ b/tests/unistd/sleep.c @@ -32,7 +32,7 @@ int main(void) // exit(EXIT_FAILURE); // } - int us_status = usleep(100); + int us_status = usleep(100000); ERROR_IF(usleep, us_status, == -1); UNEXP_IF(usleep, us_status, != 0); diff --git a/tests/waitpid.c b/tests/waitpid.c index 7f4aaf1213..4d89c078ca 100644 --- a/tests/waitpid.c +++ b/tests/waitpid.c @@ -12,7 +12,7 @@ void for_code(int code) { // Testing successful exit if (pid == 0) { // child - usleep(100); + usleep(100000); _Exit(code); } printf("Testing waitpid of child %d for code %d\n", pid, code); diff --git a/tests/waitpid_multiple.c b/tests/waitpid_multiple.c index 838b5c7659..f787c84e04 100644 --- a/tests/waitpid_multiple.c +++ b/tests/waitpid_multiple.c @@ -14,6 +14,7 @@ int main(void) { ERROR_IF(fork, pid_samepgid, == -1); if (pid_samepgid == 0) { + // child usleep(300000); _Exit(2); } @@ -25,6 +26,8 @@ int main(void) { if (pid_diffpgids[i] == 0) { int ret = setpgid(0, 0); ERROR_IF(setpgid, ret, == -1); + + // child usleep((i + 1) * 100000); _Exit(i); } @@ -35,7 +38,6 @@ int main(void) { // First, check that the first different-pgid proc is recognized. wid = waitpid(-1, &status, 0); ERROR_IF(waitpid, wid, == -1); - printf("wait 1: got %d, expected %d\n", wid, pid_diffpgids[0]); assert(wid == pid_diffpgids[0]); assert(WIFEXITED(status)); assert(WEXITSTATUS(status) == 0); @@ -43,7 +45,6 @@ int main(void) { // Then, check that the longest-waiting proc with the same pgid is properly matched. wid = waitpid(0, &status, 0); ERROR_IF(waitpid, wid, == -1); - printf("wait 2: got %d, expected %d\n", wid, pid_samepgid); assert(wid == pid_samepgid); assert(WIFEXITED(status)); assert(WEXITSTATUS(status) == 2); @@ -51,7 +52,6 @@ int main(void) { // Finally, the last different-pgid must have completed. wid = waitpid(-1, &status, WNOHANG); ERROR_IF(waitpid, wid, == -1); - printf("wait 3: got %d, expected %d\n", wid, pid_diffpgids[1]); assert(wid == pid_diffpgids[1]); assert(WIFEXITED(status)); assert(WEXITSTATUS(status) == 1);