You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6ac0c64
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ci): actually run the drivers unit suite, and stop misreporting a caller's own deadline
Second review wave on #1198. The two findings that matter are gaps in what runs
and what gets blamed.
**`packages/drivers` has never been tested in CI.** The package declares no
scripts, no job sets it as a working directory, and the TypeScript job runs
`bun test` from `packages/opencode` only. All 142 driver unit tests — the lock,
timeout and read-only regressions this PR turns on — could fail without any job
noticing. Added a `Run drivers unit suite` step to the `driver-e2e` job, and
`packages/drivers/test/**` to the `drivers` path filter.
**The DuckDB E2E step ran with a 5s per-test deadline.** Invoking `bun test`
directly does not use the package's `test` script, so it took the CLI default of
5000ms — shorter than the driver's own 30s default open budget and the lock
helper's 30s readiness budget. A step meant to prove a too-short deadline was
removed was imposing one of its own. Now `--timeout 90000`, explicitly.
**A deadline the caller set was reported as a broken client.** With
`open_timeout_ms: 1` on the connection, `warehouse_test` said "the client on
this machine is broken, nothing about your configuration is wrong, stop and
report" — for a failure the connection's own setting caused and its own setting
fixes. That is the same category error this PR exists to remove, pointing the
other way. `resolveOpenTimeoutMs` now returns the source; a connection-scoped
budget names itself in the message and classifies as `config_error`, while the
default or the env var stays `driver_open_timeout` and infrastructure.
**Also**
- The raw-lock fallback in `categorizeConnectionError` matched `could not set
lock` alone, which is generic enough to appear in an unrelated remote error —
it would have told the user to close a local process over a warehouse fault.
Now requires DuckDB's full shape (`could not set lock` *and* `conflicting
lock`).
- The `drivers` filter ignored `package.json`, `bun.lock` and
`packages/drivers/package.json`, which govern whether the native binding is
fetched at all. A change to those could break every real-DuckDB path with no
real-DuckDB job running.
- The lock helper's 30s readiness timer was never cleared, holding the event
loop open for up to 30s per call after the last assertion.
- The lock helper's child imported the driver outside its `try`, so a load
failure surfaced as a bare unhandled rejection instead of the normalised
`HOLD_FAILED` message.
**Tests.** A retry-path case in `driver-security.test.ts` that fails the first
open with DuckDB's *real* `Conflicting lock is held` text and asserts the
READ_ONLY retry fires — the existing retry test used a fabricated
`DUCKDB_LOCKED` string that the driver's original `.includes("locked")` already
matched, so it could not have caught a regression in real-message detection.
Ungated cases for the connection-scoped deadline classification and for not
claiming another driver's lock-shaped error. E2E cases asserting the deadline
message names its source, and that a connection-set deadline is `config_error` /
not infrastructure while an env-set one stays infrastructure.
Gates: typecheck 13/13; markers ok against `origin/main`; drivers 142 pass 0
fail; `test/altimate` 4224 pass 0 fail; gated E2E 21 pass 0 fail on six
consecutive runs. Lint 5864 warnings / 1 error — the error is the pre-existing
`consistent-return` in `packages/http-recorder/test/record-replay.test.ts`; the
warnings are +2 against the branch baseline, both un-awaited `mock.module` calls
in new tests, matching how every other `mock.module` in that file is written.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ
0 commit comments