nixos/tests/ringboard: poll for gedit to show up on screen

While polling with `pgrep` earlier, there was a slight chance that the
test might start writing before the application had finished
initializing. Waiting for the actual application to show up on screen
should be a better target for avoiding such a race condition.
This commit is contained in:
h7x4
2026-01-18 21:50:27 +09:00
parent e70b0cf702
commit cc660fbc68
+5 -2
View File
@@ -17,12 +17,14 @@
test-support.displayManager.auto.user = "alice";
services.xserver.displayManager.sessionCommands = ''
'${lib.getExe pkgs.gedit}' &
'${lib.getExe pkgs.gedit}' my_document &
'';
services.ringboard.x11.enable = true;
};
enableOCR = true;
testScript =
{ nodes, ... }:
let
@@ -31,7 +33,8 @@
''
@polling_condition
def gedit_running():
machine.succeed("pgrep gedit")
"Check that gedit is running and visible to the user"
machine.wait_for_text("my_document")
with subtest("Wait for service startup"):
machine.wait_for_unit("graphical.target")