wait longer for DBus in tests

While running under valgrind, it may take over 30 cycles in the loop to
wait for a running GTestDBus instance. So we have to increase the
waiting time.

Waiting a whole second will change the signal/noise ratio and will only
fail, if there's really a problem with the GTestDBus usage.

And as we're sleeping 500us in every loop, we usually get a super fast
response, too.
This commit is contained in:
Benedikt Heine 2018-12-02 16:51:47 +01:00
parent 314d982bf4
commit a8faea725d

View File

@ -130,11 +130,11 @@ TEST test_dbus_init(void)
{ {
owner_id = dbus_init(); owner_id = dbus_init();
uint waiting = 0; uint waiting = 0;
while (!dbus_conn && waiting < 20) { while (!dbus_conn && waiting < 2000) {
usleep(500); usleep(500);
waiting++; waiting++;
} }
ASSERTm("After 10ms, there is still no dbus connection available.", ASSERTm("After 1s, there is still no dbus connection available.",
dbus_conn); dbus_conn);
PASS(); PASS();
} }