Browse Source

Stabilize bash kill escalation test

Yichen Jiang 3 months ago
parent
commit
5ad483d120
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/bash/bash-local/tests/executor.spec.ts

+ 2 - 2
packages/bash/bash-local/tests/executor.spec.ts

@@ -90,8 +90,8 @@ describe('LocalBashExecutor.run', () => {
 
   it('kill escalation uses the configured graceMs (a TERM-trapping task dies by SIGKILL)', async () => {
     const { bash } = await setup() // setup pins graceMs: 200 via config
-    const task = bash.start(bash.resolve({ command: 'trap \'\' TERM; sleep 60' }))
-    await new Promise(resolve => setTimeout(resolve, 100))
+    const task = bash.start(bash.resolve({ command: 'trap \'\' TERM; echo trap-ready; sleep 60' }))
+    await readUntil(bash, task.id, 'trap-ready')
     bash.kill(task.id)
     await task.done
     expect(task.signal).toBe('SIGKILL')