Despite multiple attempts/claims at fixing this, logind still often has empty "State: closing" sessions after logout, without any processes in it [1]. Our generic nondestructive test cleanup in testlib's terminate_sessions() has a workaround for this (restarting logind). Do the same in this test.
Only do this when waiting for the session to go away; starting new sessions should work fine.
Despite multiple attempts/claims at fixing this, logind still often has empty "State: closing" sessions after logout, without any processes in it [1]. Our generic nondestructive test cleanup in testlib's terminate_sessions() has a workaround for this (restarting logind). Do the same in this test.
Only do this when waiting for the session to go away; starting new sessions should work fine.
Fixes #20379
[1] https://github.com/systemd/systemd/issues/26744
I could reproduces this rather well locally. Now it has survived two parallel loops of