mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 06:20:10 +01:00
tests: avoid race condition in nmtstc_service_cleanup()
It seems it can happen that the service is not yet unregistered from the
D-Bus broker, even if we already reaped the PID.
/builds/NetworkManager/NetworkManager/tools/run-nm-test.sh --called-from-make /builds/NetworkManager/NetworkManager/build --launch-dbus=auto /builds/NetworkManager/NetworkManager/build/libnm/tests/test-nm-client
--- stdout ---
/libnm/device-added:
nmtst: initialize nmtst_get_rand() with NMTST_SEED_RAND=0
--- stderr ---
**
test:ERROR:../shared/nm-test-utils-impl.c:216:nmtstc_service_cleanup: assertion failed: (!name_exists(info->bus, "org.freedesktop.NetworkManager"))
Workaround by waiting a bit.
We now iterate the main GMainContext, unlike before. But that
should not cause any problems for the test.
(cherry picked from commit 1b8ccacc5d)
This commit is contained in:
parent
20cfc1f395
commit
d10d14d7ba
1 changed files with 5 additions and 1 deletions
|
|
@ -213,7 +213,11 @@ again_wait:
|
|||
g_assert(ret == info->pid);
|
||||
}
|
||||
|
||||
g_assert(!name_exists(info->bus, "org.freedesktop.NetworkManager"));
|
||||
nmtst_main_context_iterate_until_assert_full(
|
||||
NULL,
|
||||
1000,
|
||||
80,
|
||||
(!name_exists(info->bus, "org.freedesktop.NetworkManager")));
|
||||
|
||||
g_clear_object(&info->bus);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue