diff options
author | Jeremy White <jwhite@codeweavers.com> | 2020-03-19 14:02:25 -0500 |
---|---|---|
committer | Jeremy White <jwhite@codeweavers.com> | 2020-04-20 12:20:03 -0500 |
commit | c5cfc19f040fce6ef6ebe2dddb2cd05614c2532f (patch) | |
tree | 6232281f48d7b1b1246f7c56314958a220890314 | |
parent | fce561c299e0d1e048c804412ee3f0a0c642877f (diff) |
Give x11spice a little time to draw.
There are times when the spice screen is not updated
insantaneously; this is particularly true when we are
not using damage.
Let's add a little delay to allow images to settle.
This makes testing more consistent and robust.
-rw-r--r-- | src/tests/tests.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tests/tests.c b/src/tests/tests.c index e9cb8f5..cf12d18 100644 --- a/src/tests/tests.c +++ b/src/tests/tests.c @@ -95,9 +95,13 @@ static void check_screenshot(test_t *test, x11spice_server_t *spice_server, xdum gchar *screencap; char buf[4096]; + /* We usually need a little bit of time for our scan to work and paint the screen */ + struct timespec delay = { 0, 200000000 }; + /* We need a delay if we are running under valgrind */ if (getenv("VALGRIND")) - sleep(2); + delay.tv_sec += 2; + nanosleep(&delay, NULL); screencap = g_test_build_filename(G_TEST_BUILT, "run", test->name, "screencap.ppm", NULL); if (strlen(spice_server->uri) >= 8 && memcmp(spice_server->uri, "spice://", 8) == 0) |