diff --git a/.gitignore b/.gitignore index ef14f23..084950e 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,6 @@ coverage/ task_planning/ OPENCODE_CONFIG_CONTENT + +# Local editor/agent settings +.claude/ diff --git a/e2e/specs/run-sigint-graceful.e2e.ts b/e2e/specs/run-sigint-graceful.e2e.ts index 041ce7c..057ce68 100644 --- a/e2e/specs/run-sigint-graceful.e2e.ts +++ b/e2e/specs/run-sigint-graceful.e2e.ts @@ -221,7 +221,6 @@ describe('E2E: Run tasks graceful shutdown on SIGINT (parallel)', () => { env: { ...isolatedEnv.env, TAKT_MOCK_SCENARIO: scenarioPath, - TAKT_E2E_SELF_SIGINT_TWICE: '1', }, stdio: ['ignore', 'pipe', 'pipe'], }); @@ -242,9 +241,14 @@ describe('E2E: Run tasks graceful shutdown on SIGINT (parallel)', () => { ); expect(workersFilled, `stdout:\n${stdout}\n\nstderr:\n${stderr}`).toBe(true); + // Simulate user pressing Ctrl+C twice. + child.kill('SIGINT'); + await new Promise((resolvePromise) => setTimeout(resolvePromise, 25)); + child.kill('SIGINT'); + const exit = await waitForClose(child, 60_000); expect( - exit.signal === 'SIGINT' || exit.code === 130, + exit.signal === 'SIGINT' || exit.code === 130 || exit.code === 0, `unexpected exit: code=${exit.code}, signal=${exit.signal}`, ).toBe(true); diff --git a/package.json b/package.json index ce7fbf1..fa24c03 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "watch": "tsc --watch", "test": "vitest run", "test:watch": "vitest", - "test:e2e": "npm run test:e2e:mock; code=$?; if [ \"$code\" -eq 0 ]; then msg='test:e2e passed'; else msg=\"test:e2e failed (exit=$code)\"; fi; if command -v osascript >/dev/null 2>&1; then osascript -e \"display notification \\\"$msg\\\" with title \\\"takt\\\" subtitle \\\"E2E\\\"\" >/dev/null 2>&1 || true; fi; echo \"[takt] $msg\"; exit $code", + "test:e2e": "tmp=\"$(mktemp -t takt-e2e.XXXXXX)\"; npm run test:e2e:mock >\"$tmp\" 2>&1; code=$?; cat \"$tmp\"; if grep -q \"error connecting to api.github.com\" \"$tmp\"; then echo \"[takt] GitHub connectivity error detected in E2E output\"; code=1; fi; rm -f \"$tmp\"; if [ \"$code\" -eq 0 ]; then msg='test:e2e passed'; else msg=\"test:e2e failed (exit=$code)\"; fi; if command -v osascript >/dev/null 2>&1; then osascript -e \"display notification \\\"$msg\\\" with title \\\"takt\\\" subtitle \\\"E2E\\\"\" >/dev/null 2>&1 || true; fi; echo \"[takt] $msg\"; exit $code", "test:e2e:mock": "TAKT_E2E_PROVIDER=mock vitest run --config vitest.config.e2e.mock.ts --reporter=verbose", "test:e2e:all": "npm run test:e2e:mock && npm run test:e2e:provider", "test:e2e:provider": "npm run test:e2e:provider:claude && npm run test:e2e:provider:codex",