Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

test(os): close Connections browser before idle checks (#1025)

Deee7f9ee40384a
diff --git a/os/tests/connections_vm.py b/os/tests/connections_vm.py
index 1c1c8a0f8..d81cf12d7 100644
--- a/os/tests/connections_vm.py
+++ b/os/tests/connections_vm.py
@@ -64,7 +64,11 @@ print('Installed Connections CLI, shared local credentials and authenticated dis
wait_installer_screen(vm, r'Access token', 'connections-token-form', timeout=15)
vm.keys('esc')
finally:
- vm.keys('alt', 'f4')
+ # Use Chromium's own close-window shortcut. Harness deliberately does
+ # not bind Alt+F4; sending it can leave the browser alive or change VT.
+ vm.keys('ctrl', 'shift', 'w')
+ vm.command('for n in $(seq 1 50); do ! pgrep -u "$(id -u)" -x chromium '
+ '>/dev/null && exit 0; sleep .1; done; exit 1', timeout=10)
# The helper is on demand, but waits 15 minutes for inactivity. Stop
# this fixture's helper before the image test records idle RAM.
pattern = r'^/usr/bin/python3 /usr/lib/harness-os/connections/connections[.]py serve --background$'