From cc660fbc680fdcabbd53817f783dbaa6e6c39c09 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 16 Nov 2025 17:16:09 +0900 Subject: [PATCH] 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. --- nixos/tests/ringboard.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nixos/tests/ringboard.nix b/nixos/tests/ringboard.nix index 9825a46d50d1..b1072d9f3267 100644 --- a/nixos/tests/ringboard.nix +++ b/nixos/tests/ringboard.nix @@ -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")