diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-03-29 13:55:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-04-02 18:02:27 +0200 |
commit | d7ba78e9c7be835a1e2ecdacd25995663e96862f (patch) | |
tree | 5140c7f2141ae27df312dbe842f68ce0cdef043d /solenv/gbuild/JunitTest.mk | |
parent | b05fb34d48da717447b9b86db9546df72b25e988 (diff) |
New --with-coredumpctl to obtain core dumps of crashed tests from coredumpctl
...for (Linux) systems that don't store core.* files in the current working
directory. When enabled, this wraps test execution in `systemd-run --scope
--user --unit=...` with unit values unique per individual test invocation, so
that solenv/bin/gdb-core-bt.sh can query coredumpctl for matching core dumps.
(See the mailing list thread starting at
<https://lists.freedesktop.org/archives/systemd-devel/2023-March/048884.html>
"[systemd-devel] coredumpctl: matching by e.g. env var?" for further details.)
The used --unit=... scheme is a best effort to produce system-wide unique
values, combining the target location path of the given test with a
second-granularity date/time and the current PID. (In case there would be
multiple invocations of the same test per second, which then hopefully wouldn't
reuse the same PID. The date/time and PID could be replaced with a
high-resolution system-wide monotonic clock/counter if one were easily
available. The advantage of the current scheme is that it only uses Posix
features.) The overall length of the unit value (incl. the appended ".scope"
suffix) must not exceed 256 characters, or else systemd-run would fail with
"Failed to mangle scope name: Invalid argument".
It might look more natural to pass the unit value into gdb-core-bt.sh as a
fourth positional argument rather than via a new LIBO_TEST_UNIT env var. But
for one, the unit value is most easily computed from within the recipe shell
command lines, where an env var is the most natural fit. And for another, this
avoids having to tunnel yet another value through the tearDown method in
unotest/source/java/org/openoffice/test/OfficeConnection.java to the given
postprocesscommand.
Change-Id: Idcb20cd1e1141d8ec7f10947e5edc70aa2aa7d32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149690
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'solenv/gbuild/JunitTest.mk')
-rw-r--r-- | solenv/gbuild/JunitTest.mk | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk index 401c8ff5cd97..66f90a34f4c8 100644 --- a/solenv/gbuild/JunitTest.mk +++ b/solenv/gbuild/JunitTest.mk @@ -41,7 +41,9 @@ else rm -rf $(call gb_JunitTest_get_userdir,$*) && \ mkdir -p $(call gb_JunitTest_get_userdir,$*)/user && \ cp $(SRCDIR)/qadevOOo/qa/registrymodifications.xcu $(call gb_JunitTest_get_userdir,$*)/user/ && \ - ($(gb_TEST_ENV_VARS) $(ICECREAM_RUN) $(gb_JunitTest_JAVACOMMAND) \ + $(call gb_CppunitTest_coredumpctl_setup,$@) \ + ($(gb_TEST_ENV_VARS) $(ICECREAM_RUN) $(gb_CppunitTest_coredumpctl_run) \ + $(gb_JunitTest_JAVACOMMAND) \ -classpath "$(T_CP)" \ $(DEFS) \ org.junit.runner.JUnitCore \ |