From: "Jamie Magee via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Jamie Magee <jamie.magee@gmail.com>, Jamie Magee <jamie.magee@gmail.com>
Subject: [PATCH] t0213: skip ancestry tests under user-mode emulation
Date: Mon, 06 Jul 2026 17:34:01 +0000 [thread overview]
Message-ID: <pull.2168.git.1783359242130.gitgitgadget@gmail.com> (raw)
From: Jamie Magee <jamie.magee@gmail.com>
The tests added in 3c8c638df6 (t0213: add trace2 cmd_ancestry tests,
2026-02-13) expect the cmd_ancestry event to name "test-tool" and
"git". On Linux those names come from the "comm" field of
/proc/<pid>/stat. Under user-mode emulation (e.g. qemu-user) /proc
reports the emulator ("qemu-riscv64") instead, so the event is still
emitted, the TRACE2_ANCESTRY probe enables the tests, and tests 2-5
fail even though they pass on native riscv64.
Require the probe to see "test-tool" in the ancestry of a test-tool
spawned from test-tool, so the tests skip when the names are unreliable.
Cc: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Jamie Magee <jamie.magee@gmail.com>
---
t0213: skip ancestry tests under user-mode emulation
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2168%2FJamieMagee%2Ft0213-skip-under-emulation-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2168/JamieMagee/t0213-skip-under-emulation-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2168
t/t0213-trace2-ancestry.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/t/t0213-trace2-ancestry.sh b/t/t0213-trace2-ancestry.sh
index a2b9536da8..2eb86c1952 100755
--- a/t/t0213-trace2-ancestry.sh
+++ b/t/t0213-trace2-ancestry.sh
@@ -31,12 +31,15 @@ PATH="$TTDIR:$PATH" && export PATH
# no cmd_ancestry event is emitted. We detect this at runtime and
# skip the format-specific tests accordingly.
-# Determine if cmd_ancestry is supported on this platform.
+# Enable these tests only when cmd_ancestry reports real process names.
+# The procinfo stub emits no event; under user-mode emulation (e.g.
+# qemu-user) /proc reports the emulator, not the guest. Spawn test-tool
+# from test-tool and require "test-tool" in the child's ancestry.
test_expect_success 'detect cmd_ancestry support' '
test_when_finished "rm -f trace.detect" &&
GIT_TRACE2_BRIEF=1 GIT_TRACE2="$(pwd)/trace.detect" \
- test-tool trace2 001return 0 &&
- if grep -q "^cmd_ancestry" trace.detect
+ test-tool trace2 004child test-tool trace2 001return 0 &&
+ if grep -q "^cmd_ancestry.*test-tool" trace.detect
then
test_set_prereq TRACE2_ANCESTRY
fi
base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc
--
gitgitgadget
next reply other threads:[~2026-07-06 17:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 17:34 Jamie Magee via GitGitGadget [this message]
2026-07-07 2:30 ` [PATCH] t0213: skip ancestry tests under user-mode emulation Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.2168.git.1783359242130.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=jamie.magee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox