Re: [PATCH] t0213: skip ancestry tests under user-mode emulation
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 7, 2026, 02:30 UTC
- Message-ID
- <xmqqa4s38rbe.fsf@gitster.g>
- In-Reply-To
- <pull.2168.git.1783359242130.gitgitgadget@gmail.com>
"Jamie Magee via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 5 quoted lines
> -# 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.
T.r.i.c.k.y. ;-)
Show 7 quoted lines
> 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
This will be happy even if "test-tool-trash" that happens to have "test-tool" as its prefix appears on a cmd_ancestry line (for that matter, things like "cmd_ancestry-not-quite" that has "cmd_ancestry" as its prefix would be accepted). I guess that is OK because we are testing this in a fairly tightly controlled environment (trace keys are taken from known vocabulary, not arbitrary strings, for example).
Will queue. Thanks.
Show 5 quoted lines
> then > test_set_prereq TRACE2_ANCESTRY > fi > > base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc