test(e2e): retry the dbconnect pip fallback through transient Windows file locks - #2120
Merged
Conversation
rugpanov
requested a deployment
to
test-trigger-is
August 14, 2026 13:53 — with
GitHub Actions
Queued
rugpanov
force-pushed
the
fix/e2e-dbconnect-pip-retry
branch
from
August 14, 2026 13:57
0a47701 to
3d6176c
Compare
Contributor
Author
|
🤖 Integration tests triggered for |
rugpanov
requested a deployment
to
test-trigger-is
August 14, 2026 13:58 — with
GitHub Actions
Queued
… file locks
*Why*
The `run_dbconnect` e2e test's `should setup virtual environment` step flakes
on the Windows shard. When the extension's install path leaves
databricks-connect missing, the test's own `ensureVenvHasDbConnect` fallback
runs `pip install databricks-connect`. While pip overwrites the venv's existing
numpy it can hit `[WinError 32] The process cannot access the file because it is
being used by another process` on a numpy file — a transient lock (a scanner or
a still-running install holding it open). The fallback swallowed that error and
moved on, so databricks-connect stayed missing and the downstream
"Databricks Connect:" tree-item check timed out with "Setup confirmation
failed". `ensureVenvHasKernelDeps` had the same single-shot-then-swallow shape.
*What*
- Add `src/test/retry.ts` — a pure `retryOnTransientError` helper plus an
`isTransientFileLockError` predicate (matches WinError 32 "used by another
process" and WinError 5 "Access is denied", searching `.message`/`.stderr`/
`.stdout` since Node's execFile hides the OSError in stderr). Lives under
`src/test/` (not `src/test/e2e/`, which tsconfig excludes from the unit
build) so it can carry a colocated unit test; e2e imports it via `.ts`.
- Add `src/test/retry.test.ts` — unit coverage for success, retry-then-succeed,
linear backoff, give-up-after-N, non-transient-rethrow, and the predicate.
- Wrap both fallback pip installs in `run_dbconnect.ucws.e2e.ts` with the
helper (3 attempts, 5s linear backoff), logging each retry so a real Windows
UX regression stays visible in nightly logs. The final swallow+log and the
ground-truth tree-item assertion are unchanged.
Test-only: no production code, settings, persisted state, telemetry, or
when-clause flags — zero user-facing impact.
*Verification*
- `retry.test.ts`: 9 passing (ts-mocha, written red-first then green).
- e2e file type-checks under `src/test/e2e/tsconfig.json` (the sole error is a
pre-existing `assert {type: "json"}` in `wdio.conf.ts`, untouched here).
- `yarn build` compiles both new files into `out/` so the unit-suite glob
picks up the test; eslint + `prettier -c` clean on all touched files.
Co-authored-by: Isaac
rugpanov
force-pushed
the
fix/e2e-dbconnect-pip-retry
branch
from
August 14, 2026 14:04
3d6176c to
68a6a75
Compare
rugpanov
requested a deployment
to
test-trigger-is
August 14, 2026 14:06 — with
GitHub Actions
Queued
Contributor
Author
|
🤖 Integration tests ❌ 1 of 35 test jobs failed for |
misha-db
approved these changes
Aug 14, 2026
rugpanov
enabled auto-merge (squash)
August 14, 2026 16:34
Contributor
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
rugpanov
requested a deployment
to
test-trigger-is
August 14, 2026 16:36 — with
GitHub Actions
Queued
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
run_dbconnecte2e test's should setup virtual environment step flakes on the Windows shard. When the extension's install path leavesdatabricks-connectmissing, the test's ownensureVenvHasDbConnectfallback runspip install databricks-connect. While pip overwrites the venv's existing numpy it can hit:— a transient lock (a scanner or a still-running install holding the file open). The fallback swallowed that error and moved on, so
databricks-connectstayed missing and the downstream"Databricks Connect:"tree-item check timed out withSetup confirmation failed.ensureVenvHasKernelDepshad the same single-shot-then-swallow shape.What
src/test/retry.ts— a pureretryOnTransientErrorhelper plus anisTransientFileLockErrorpredicate (matches WinError 32 "used by another process" and WinError 5 "Access is denied", searching.message/.stderr/.stdoutsince Node'sexecFilehides the OSError in stderr). It lives undersrc/test/rather thansrc/test/e2e/—tsconfig.jsonexcludes the e2e folder from the unit build, so a colocated unit test only runs when the module sits outside it; the e2e spec imports it via an explicit.tsextension (as e2e specs already do forsrc/modules).src/test/retry.test.ts— unit coverage: success without sleeping, retry-then-succeed, linear backoff, give-up-after-N, non-transient-rethrow,onRetryreporting, and the predicate's positive/negative cases.run_dbconnect.ucws.e2e.ts— both fallback pip installs now run through the helper (3 attempts, 5s linear backoff), logging each retry so a real Windows UX regression stays visible in nightly logs. The final swallow+log and the ground-truth tree-item assertion are unchanged.Test-only: no production code, settings, persisted state, telemetry, or when-clause flags — zero user-facing impact and nothing changes for shards that never hit the lock.
Verification
retry.test.ts: 9 passing (written red-first, then green).test:unit): 818 passing, 0 failing (10 pre-existing pending).src/test/e2e/tsconfig.json(the only error is a pre-existingassert {type: "json"}inwdio.conf.ts, untouched here).eslint+prettier -cclean on all touched files.This pull request and its description were written by Isaac.