[newlib-cygwin/main] Cygwin: testsuite: Add a small delay in kill01

Jon Turney jturney@sourceware.org
Fri Aug 11 13:38:37 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7374b46bfd5ca551febf7883f6fce22f27a18aa8

commit 7374b46bfd5ca551febf7883f6fce22f27a18aa8
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Tue Aug 8 16:38:20 2023 +0100

    Cygwin: testsuite: Add a small delay in kill01
    
    Avoid transient failures by adding a small delay after fork()-ing to
    allow the child to get into a state where it can recieve signals.
    
    Also add same small delay to kill03 and kill04. kill02 has a more
    elaborate setup where child processes write to a pipe to indicate they
    have started.

Diff:
---
 winsup/testsuite/winsup.api/ltp/kill01.c | 1 +
 winsup/testsuite/winsup.api/ltp/kill03.c | 1 +
 winsup/testsuite/winsup.api/ltp/kill04.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/winsup/testsuite/winsup.api/ltp/kill01.c b/winsup/testsuite/winsup.api/ltp/kill01.c
index 042899173..5f0a32ba9 100644
--- a/winsup/testsuite/winsup.api/ltp/kill01.c
+++ b/winsup/testsuite/winsup.api/ltp/kill01.c
@@ -102,6 +102,7 @@ main(int ac, char **av)
 			/*NOTREACHED*/
 			exit(exno);
 		} else {
+			usleep(1000);
 			TEST(kill(pid, TEST_SIG));
 			waitpid(pid, &status, 0);
 		}
diff --git a/winsup/testsuite/winsup.api/ltp/kill03.c b/winsup/testsuite/winsup.api/ltp/kill03.c
index 1de727fd7..eb75fdb38 100644
--- a/winsup/testsuite/winsup.api/ltp/kill03.c
+++ b/winsup/testsuite/winsup.api/ltp/kill03.c
@@ -106,6 +106,7 @@ main(int ac, char **av)
 			/*NOTREACHED*/
 			exit(exno);
 		} else {
+			usleep(1000);
 			TEST(kill(pid, TEST_SIG));
 			kill(pid, SIGKILL);
 			waitpid(pid, &status, 0);
diff --git a/winsup/testsuite/winsup.api/ltp/kill04.c b/winsup/testsuite/winsup.api/ltp/kill04.c
index a7b3274c3..c3314f35d 100644
--- a/winsup/testsuite/winsup.api/ltp/kill04.c
+++ b/winsup/testsuite/winsup.api/ltp/kill04.c
@@ -114,6 +114,7 @@ main(int ac, char **av)
 				/*NOTREACHED*/
 				exit(exno);
 			}
+			usleep(1000);
 			kill(fake_pid, TEST_SIG);
 			waitpid(fake_pid, &fake_status, 0);
 			TEST(kill(fake_pid, TEST_SIG));


More information about the Cygwin-cvs mailing list