mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-05 18:08:02 +02:00
Testsuite: Reduce race condition in history purging check
Previously we set the "max age" to seconds and then waited for exactly 2 seconds until we wrote the history data back to files. In a lot of cases this actually took a tad more than 2 seconds, which caused the second-last history entry to disappear as well. Reduce the waiting to 1.1 seconds, which will now give us 900 ms to write back the history file. Still not ideal, but the best we can do in the test suite.
This commit is contained in:
parent
e38cddbb8e
commit
83f1a6394b
1 changed files with 1 additions and 1 deletions
|
|
@ -223,7 +223,7 @@ up_test_history_func (void)
|
|||
|
||||
/* ensure old entries are purged */
|
||||
up_history_set_max_data_age (history, 2);
|
||||
g_usleep (2 * G_USEC_PER_SEC);
|
||||
g_usleep (1100 * G_USEC_PER_SEC / 1000);
|
||||
g_object_unref (history);
|
||||
|
||||
/* ensure only 2 points are returned */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue