Closed martinpitt closed 5 months ago
Reproducer:
test/verify/check-system-services TestServices.testTransientUnits $RUNC -stv
I'm adding the kpatch logging fix here. It's too small to warrant its own PR, and it will help us to track down that bug (if it even still happens after this).
I'll pull this into all of our projects to validate that this works everywhere.
Most of our tests don't bother logging out at the end, they rely on our generic nondestructive setup. But this causes some noise when using
restore_dir()
and friends, e.g. in TestApps.testBasic:As the tests themselves call
restore_dir()
(which happens after the genericnonDestructiveSetup()
, the restoration also happens beforenonDestructiveSetup()
can kill all running sessions. Thus the cockpit page, bridge etc. are still active then and keep messing around with the file system.This don't actually break the test, but errors like the above are confusing when debugging and staring at test output.
To clean this up, move the session termination into
tearDown()
, which runs first after the test method ends -- in particular, before theaddCleanup()
handlers. Move the previously nestedterminate_sessions()
helper function to a private method of MachineCase, so thattearDown()
does not get too long.This removes the need to daemon-reload the
admin
user session in TestService's cleanup -- at that point there are no user sessions at all any more.This should fix #20446 as far as I understand it. If not, it at least gets rid of some unrelated noise.