Skip to content

test(core): host-lease test closes its connections before removing the directory (Windows EBUSY) - #999

Merged
jimhoyd merged 1 commit into
mainfrom
claude/host-lease-test-cleanup
Sep 29, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
claude/host-lease-test-cleanup

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

On Windows, test/host-lease.test.ts (added in #991) intermittently failed every test with EBUSY ... unlink lease.sqlite, then timed out after about 132 s each. This was seen on PR #992's verify (windows-latest, 24, 1).

Cause: t.after hooks run in registration order. directory() registered the directory removal before connect() registered the connection close, so the removal ran while the SQLite file was still open. Windows refuses that, and rm retried until the timeout.

Fix: each directory's single cleanup hook now closes every connection opened in it, then removes the directory. The order no longer depends on how callers register hooks. The same pattern was fixed in the audit test in #949.

Checked locally: 8/8 pass on macOS. The Windows result comes from this PR's CI.

🤖 Generated with Claude Code

…irectory (Windows EBUSY)

t.after hooks run in registration order, and directory() registered the rm before connect() registered the close, so on
Windows the rm hit EBUSY on lease.sqlite and retried until the test timed out (seen on PR #992's Windows shard).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jimhoyd
jimhoyd enabled auto-merge (squash) September 29, 2026 23:02
@jimhoyd
jimhoyd merged commit e2f4536 into main Sep 29, 2026
22 checks passed
@jimhoyd
jimhoyd deleted the claude/host-lease-test-cleanup branch September 29, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant