From 0e655158627fba890c5a42074c722521ac48ef5d Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Tue, 26 Sep 2023 17:47:03 +0200 Subject: [PATCH] support/runtime-test: fix weston test The weston runtime test uses the CRC of the framebuffer to detect that "something" is being drawned on the framebuffer. This requires that the sampling of the CRC happens does not happen too early after trigerring an action, or the rendering may be not be finishe, either: - weston may not have had time to initialise, or - the test application may not have started rednering, The sequence of rendering that has been observed yields this sequence of CRCs (elided for brevity): - boot: - alternating between 0x4c4126bf and 0x5d2f9aa5: console cursor blinking - start weston: - 0x4c4126bf: weston switches to a cleared vt, no blinking cursor ... - 0xe54b7895: weston is starting ... - 0xe54b7895: wayland socket appears! ... - 0x6bf28bdf: weston is ready ... - start weston-simple-egl: - 0x6bf28bdf: application is starting ... - 0xNNNNNNNN: random CRCs while the application renders ... - stop weston-simple-egl: - 0xNNNNNNNN: zero, one, or two random CRCs while the application renders before it handles SIGTERM - 0x6bf28bdf: application is stopped ... - stop weston: - 0x6bf28bdf: a few CRC identical to when weston was started, while weston is processing SIGTERM - oscillating between 0x4c4126bf and 0x5d2f9aa5: console cursor blinking, back to initial vt, weston dead. So, we need to wait "enough" after each action. Moreover, when the wayland socket appears, weston may not have stabilised yet, so we also need to wait after the socket appears. Signed-off-by: Yann E. MORIN Cc: Julien Olivain --- support/testing/tests/package/test_weston.py | 1 + 1 file changed, 1 insertion(+) diff --git a/support/testing/tests/package/test_weston.py b/support/testing/tests/package/test_weston.py index 276788c649..df1b7a4135 100644 --- a/support/testing/tests/package/test_weston.py +++ b/support/testing/tests/package/test_weston.py @@ -78,6 +78,7 @@ class TestWeston(infra.basetest.BRTest): wayland_socket = "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}" cmd = f"while [ ! -e \"{wayland_socket}\" ] ; do sleep 1 ; done" self.assertRunOk(cmd, timeout=10) + time.sleep(4) def stop_weston(self): cmd = "killall weston && sleep 3"