mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 12:18:13 +02:00
containers test: Wait a few more seconds for the socket to be deleted
Previously, we were waiting a few seconds for the dbus-daemon to stop listening, then trying to connect again and asserting that it failed, then immediately asserting that the socket had actually been deleted. However, there is a race here: the dbus-daemon stops listening on the socket, and then deletes it. If the test client wins the race by probing to see whether the socket is present after the dbus-daemon has stopped listening but before the dbus-daemon has deleted it, then the test will fail. This intermittently happens on Gitlab-CI, most recently in <https://gitlab.freedesktop.org/smcv/dbus/-/jobs/45694>. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
c018e0b1b2
commit
c2ee90375a
1 changed files with 8 additions and 0 deletions
|
|
@ -1005,6 +1005,14 @@ test_stop_server (Fixture *f,
|
|||
g_clear_error (&f->error);
|
||||
g_assert_null (second_confined_conn);
|
||||
|
||||
/* Deleting the socket is not synchronous with respect to stopping
|
||||
* listening on it, so again we are willing to wait a few seconds */
|
||||
for (i = 0; i < 50; i++)
|
||||
{
|
||||
if (g_file_test (f->socket_path, G_FILE_TEST_EXISTS))
|
||||
g_usleep (G_USEC_PER_SEC / 10);
|
||||
}
|
||||
|
||||
/* The socket has been deleted */
|
||||
g_assert_false (g_file_test (f->socket_path, G_FILE_TEST_EXISTS));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue