mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-07 05:56:41 +02:00
fix: E2E exit reason precedence + worktree prune race condition
Two fixes for E2E test reliability: 1. session-runner.ts: error_max_turns was misclassified as error_api because is_error flag was checked before subtype. Now known subtypes like error_max_turns are preserved even when is_error is set. The is_error override only applies when subtype=success (API failure). 2. worktree.ts: pruneStale() now skips worktrees < 1 hour old to avoid deleting worktrees from concurrent test runs still in progress. Previously any second test execution would kill the first's worktrees. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -231,6 +231,9 @@ describe('WorktreeManager', () => {
|
||||
spawnSync('git', ['worktree', 'remove', '--force', oldPath], { cwd: repo, stdio: 'pipe' });
|
||||
// Recreate the directory to simulate orphaned state
|
||||
fs.mkdirSync(oldPath, { recursive: true });
|
||||
// Backdate mtime to simulate a stale worktree (> 1 hour old)
|
||||
const staleTime = new Date(Date.now() - 7200_000);
|
||||
fs.utimesSync(oldRunDir, staleTime, staleTime);
|
||||
|
||||
// New manager should prune the old run's directory
|
||||
const newMgr = new WorktreeManager(repo);
|
||||
|
||||
Reference in New Issue
Block a user