Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Mar 2021 14:05:24 GMT
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 80c34bad1979 - stable/13 - Remove atf_tc_skip calls from ptrace_test
Message-ID:  <202103171405.12HE5O5E086119@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by arichardson:

URL: https://cgit.FreeBSD.org/src/commit/?id=80c34bad19795b6f4ddf9d6e339cf600118f05b0

commit 80c34bad19795b6f4ddf9d6e339cf600118f05b0
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2021-03-01 18:51:02 +0000
Commit:     Alex Richardson <arichardson@FreeBSD.org>
CommitDate: 2021-03-17 12:24:02 +0000

    Remove atf_tc_skip calls from ptrace_test
    
    I've run these tests many times in a loop on multiple architectures and
    it works reliably for me, maybe it's time to retire these skips?
    This also adds an additional waitpid to one of the tests to avoid
    a potential race condition (suggested by markj@).
    
    PR:             239397, 244056, 239425, 240510, 220841, 243605
    Reviewed By:    markj
    Differential Revision: https://reviews.freebsd.org/D28888
    
    (cherry picked from commit 1032131464f1196ad674b30c14a9e611789a1061)
---
 tests/sys/kern/ptrace_test.c | 29 ++---------------------------
 1 file changed, 2 insertions(+), 27 deletions(-)

diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c
index a5655008eaa1..c6183ed573fd 100644
--- a/tests/sys/kern/ptrace_test.c
+++ b/tests/sys/kern/ptrace_test.c
@@ -237,9 +237,6 @@ ATF_TC_BODY(ptrace__parent_wait_after_attach, tc)
 	int cpipe[2], status;
 	char c;
 
-	if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
-		atf_tc_skip("https://bugs.freebsd.org/244055");
-
 	REQUIRE_EQ(pipe(cpipe), 0);
 	ATF_REQUIRE((child = fork()) != -1);
 	if (child == 0) {
@@ -287,9 +284,6 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debugger, tc)
 	int cpipe[2], dpipe[2], status;
 	char c;
 
-	if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
-		atf_tc_skip("https://bugs.freebsd.org/239399");
-
 	REQUIRE_EQ(pipe(cpipe), 0);
 	ATF_REQUIRE((child = fork()) != -1);
 
@@ -493,9 +487,6 @@ ATF_TC_BODY(ptrace__parent_exits_before_child, tc)
 	int cpipe1[2], cpipe2[2], gcpipe[2], status;
 	pid_t child, gchild;
 
-	if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
-		atf_tc_skip("https://bugs.freebsd.org/244056");
-
 	REQUIRE_EQ(pipe(cpipe1), 0);
 	REQUIRE_EQ(pipe(cpipe2), 0);
 	REQUIRE_EQ(pipe(gcpipe), 0);
@@ -834,9 +825,6 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelated_debugger, tc)
 	pid_t children[2], fpid, wpid;
 	int cpipe[2], status;
 
-	if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
-		atf_tc_skip("https://bugs.freebsd.org/239397");
-
 	REQUIRE_EQ(pipe(cpipe), 0);
 	ATF_REQUIRE((fpid = fork()) != -1);
 	if (fpid == 0) {
@@ -905,9 +893,6 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelated_debugger, tc)
 	pid_t children[2], fpid, wpid;
 	int cpipe[2], status;
 
-	if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
-		atf_tc_skip("https://bugs.freebsd.org/239292");
-
 	REQUIRE_EQ(pipe(cpipe), 0);
 	ATF_REQUIRE((fpid = fork()) != -1);
 	if (fpid == 0) {
@@ -971,9 +956,6 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrelated_debugger, tc)
 	pid_t children[2], fpid, wpid;
 	int cpipe[2], status;
 
-	if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
-		atf_tc_skip("https://bugs.freebsd.org/239425");
-
 	REQUIRE_EQ(pipe(cpipe), 0);
 	ATF_REQUIRE((fpid = fork()) != -1);
 	if (fpid == 0) {
@@ -1036,9 +1018,6 @@ ATF_TC_BODY(ptrace__getppid, tc)
 	int cpipe[2], dpipe[2], status;
 	char c;
 
-	if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
-		atf_tc_skip("https://bugs.freebsd.org/240510");
-
 	REQUIRE_EQ(pipe(cpipe), 0);
 	ATF_REQUIRE((child = fork()) != -1);
 
@@ -2123,9 +2102,6 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc)
 	struct ptrace_lwpinfo pl;
 	struct sched_param sched_param;
 
-	if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
-		atf_tc_skip("https://bugs.freebsd.org/220841");
-
 	ATF_REQUIRE((fpid = fork()) != -1);
 	if (fpid == 0) {
 		trace_me();
@@ -4219,9 +4195,6 @@ ATF_TC_BODY(ptrace__procdesc_reparent_wait_child, tc)
 	pid_t traced, debuger, wpid;
 	int pd, status;
 
-	if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
-		atf_tc_skip("https://bugs.freebsd.org/243605");
-
 	traced = pdfork(&pd, 0);
 	ATF_REQUIRE(traced >= 0);
 	if (traced == 0) {
@@ -4230,6 +4203,8 @@ ATF_TC_BODY(ptrace__procdesc_reparent_wait_child, tc)
 	}
 	ATF_REQUIRE(pd >= 0);
 
+	/* Wait until the child process has stopped before fork()ing again. */
+	REQUIRE_EQ(traced, waitpid(traced, &status, WSTOPPED));
 	debuger = fork();
 	ATF_REQUIRE(debuger >= 0);
 	if (debuger == 0) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103171405.12HE5O5E086119>