From 017470398f7535913a86922779a5a46ef93cdfef Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Sat, 12 Apr 2025 21:35:30 +0530 Subject: [PATCH] nixosTests/cosmic: add timeouts as to not waste time and hold resources The NixOS tests for COSMIC fail on `aarch64-linux`. So far, this points to virgl/opengl not working properly on aarch64+qemu but we don't enable 3D acceleration on `x86_64-linux` either. Regardless, this means that tests on `aarch64-linux` that are failing, are not failing early enough and become a 15 minute (900 seconds is the default timeout) resource hog on Ofborg and Hydra. A temporary way around this problem is to introduce shorter timeouts than the default of 900 seconds. --- nixos/tests/cosmic.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nixos/tests/cosmic.nix b/nixos/tests/cosmic.nix index 227640c078ee..3f48a384913a 100644 --- a/nixos/tests/cosmic.nix +++ b/nixos/tests/cosmic.nix @@ -75,14 +75,14 @@ if (enableAutologin) then '' with subtest("cosmic-greeter initialisation"): - machine.wait_for_unit("graphical.target") + machine.wait_for_unit("graphical.target", timeout=120) '' else '' from time import sleep - machine.wait_for_unit("graphical.target") - machine.wait_until_succeeds("pgrep --uid ${toString cfg.users.users.cosmic-greeter.name} --full cosmic-greeter") + machine.wait_for_unit("graphical.target", timeout=120) + machine.wait_until_succeeds("pgrep --uid ${toString cfg.users.users.cosmic-greeter.name} --full cosmic-greeter", timeout=30) # Sleep for 10 seconds for ensuring that `greetd` loads the # password prompt for the login screen properly. sleep(10) @@ -96,7 +96,7 @@ # `cosmic-session` target is the Workspaces applet. So, wait # for it to start. The process existing means that COSMIC # now handles any opened windows from now on. - machine.wait_until_succeeds("pgrep --uid ${toString user.uid} --full 'cosmic-panel-button com.system76.CosmicWorkspaces'") + machine.wait_until_succeeds("pgrep --uid ${toString user.uid} --full 'cosmic-panel-button com.system76.CosmicWorkspaces'", timeout=30) # The best way to test for Wayland and XWayland is to launch # the GUI applications and see the results yourself. @@ -121,7 +121,7 @@ machine.wait_until_succeeds(f''''su - ${user.name} -c 'WAYLAND_DISPLAY=wayland-1 XDG_RUNTIME_DIR=/run/user/${toString user.uid} lswt --json | jq ".toplevels" | grep "^ \\"app-id\\": \\"{app_id}\\"$"' '''', timeout=30) machine.succeed(f"pkill {gui_app}", timeout=5) - machine.succeed("echo 'test completed succeessfully' > /${testName}") + machine.succeed("echo 'test completed succeessfully' > /${testName}", timeout=5) machine.copy_from_vm('/${testName}') machine.shutdown()