dbus/test/bus
Simon McVittie bef88fd562 test/bus: Break up dispatch test into three separate tests
This is really three separate test-cases: one for traditional
activation as a direct child process of the dbus-daemon, and two for
traditional activation (successful and failing) via the setuid
dbus-daemon-launch-helper on Unix.

The ones where activation succeeds extremely slow, as a result of the
instrumentation for simulating malloc() failures combined with a large
number of memory operations, particularly when using AddressSanitizer.

Splitting up "OOM" tests like these has a disproportionately good impact
on the time they take, because the simulated malloc() failure
instrumentation repeats the entire test making the first malloc() fail,
then making the second malloc() fail, and so on. For allocation failures
in the second half of the test, this means we repeat the first half of
the test with no malloc() failures a very large number of times, which
is not a good use of time, because we already tested it successfully.

Even when not using the "OOM" instrumentation, splitting up these tests
lets them run in parallel, which is also a major time saving.

Needless to say, this speeds up testing considerably. On my modern but
unexceptional x86 laptop, in a typical debug build with Meson, the old
dispatch test took just over 21 minutes, which drops to about 40 seconds
each for the new normal-activation and helper-activation tests (and for
most of that time, they're running in parallel, so the wall-clock time
taken for the whole test suite is somewhere around a minute).

In a debug build with Meson, gcc and AddressSanitizer, the old dispatch
test takes longer than my patience will allow, and the new separate
tests take about 5-6 minutes each. Reduce their timeout accordingly, but
not as far as the default for slow tests (5 minutes) to allow some
headroom for AddressSanitizer or slower systems.

The failed-helper-activation test is almost instantaneous, and no longer
needs to be marked as slow.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-18 11:15:54 +00:00
..
common.c test/bus: Factor out common setup/teardown code 2022-07-18 11:15:54 +00:00
common.h test/bus: Factor out common setup/teardown code 2022-07-18 11:15:54 +00:00
dispatch-sha1.c test/bus: Factor out common setup/teardown code 2022-07-18 11:15:54 +00:00
failed-helper-activation.c test/bus: Break up dispatch test into three separate tests 2022-07-18 11:15:54 +00:00
helper-activation.c test/bus: Break up dispatch test into three separate tests 2022-07-18 11:15:54 +00:00
launch-helper-for-tests.c test: Move dbus-daemon-launch-helper-test here, and rename 2019-01-21 15:18:46 +00:00
launch-helper-oom.c _dbus_test_main: Move to test-utils 2019-01-21 15:19:36 +00:00
main.c test/bus: Factor out common setup/teardown code 2022-07-18 11:15:54 +00:00
normal-activation.c test/bus: Break up dispatch test into three separate tests 2022-07-18 11:15:54 +00:00
system.c _dbus_test_main: Move to test-utils 2019-01-21 15:19:36 +00:00