git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/tests/chromium: Fix a race condition

Only execute Ctrl+w to close the currently active window if the new/secondary window (title: "New Tab") could be selected. This fixes a test failure since the update to Chromium M88 (cc PR #110010). Without this additional check the main window (title: "startup done") could still be selected (and thus will be closed) and the script would close both windows (i.e. terminate Chromium completely).

commit8a7a8442c172bf419853b3d40e245fbc9bf69759 authorMichael Weiss <dev.primeos@gmail.com> dateWed 20 Jan 2021, 16:42 (6 years ago) parent3df16a4
1 file changed+8−7
nixos/tests/chromium.nix+8−7
nixos/tests/chromium.nix+8−7
@@ -80,7 +80,7 @@ mapAttrs (channel: chromiumPkg: makeTest rec {
8080
8181 def close_win():
8282 def try_close(_):
83− machine.execute(
83+ status, _ = machine.execute(
8484 ru(
8585 "${xdo "close-window" ''
8686 search --onlyvisible --name "new tab"
@@ -89,13 +89,14 @@ mapAttrs (channel: chromiumPkg: makeTest rec {
8989 ''}"
9090 )
9191 )
92− machine.execute(
93− ru(
94− "${xdo "close-window" ''
95− key Ctrl+w
96− ''}"
92+ if status == 0:
93+ machine.execute(
94+ ru(
95+ "${xdo "close-window" ''
96+ key Ctrl+w
97+ ''}"
98+ )
9799 )
98− )
99100 for _ in range(1, 20):
100101 status, out = machine.execute(
101102 ru(