Skip to content

The agent that grows with you

test(desktop): cover detached SSH startup readiness

Yuan Liefbb5c98dae4
diff --git a/apps/desktop/electron/remote-lifecycle.test.ts b/apps/desktop/electron/remote-lifecycle.test.ts
index b682644ec8a..66b88de9175 100644
--- a/apps/desktop/electron/remote-lifecycle.test.ts
+++ b/apps/desktop/electron/remote-lifecycle.test.ts
@@ -1141,8 +1141,11 @@ test('connect() spawns fresh when there is no lockfile, adopts the served token'
[/python3 -c/, ''], // token file write
[/printf '%s\\n'/, ''],
[/setsid/, '777\n'],
- [/kill -0 777/, 'ALIVE'],
- [/cat .*\.log/, 'HERMES_DASHBOARD_READY port=51999\n']
+ // The wrapper may exit before the detached daemon writes READY; startup
+ // must rely on the bounded log wait rather than kill -0 on this pid.
+ [/cat .*\.log/, 'HERMES_DASHBOARD_READY port=51999\n'],
+ // The post-readiness served-token adoption still verifies the daemon.
+ [/kill -0 777/, 'ALIVE']
])
const result = await connect(
@@ -1844,7 +1847,7 @@ test('connect removes the token file when a fresh backend fails after returning
[/kill -0 999/, 'DEAD']
])
- await assert.rejects(() => connect(connectDeps(ssh)), /exited before announcing/i)
+ await assert.rejects(() => connect(connectDeps(ssh)), /Timed out waiting for the remote dashboard/i)
assert.ok(ssh.calls.some(command => /rm -f .*\.token/.test(command)))
})