test: diagnose Windows descendant readiness boundary - #121
Conversation
📝 WalkthroughWalkthroughThe fake secret provider emits a startup sentinel, and Windows tests wait for it before validating command settlement or orphaned-descendant behavior. ChangesWindows provider lifecycle
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
d031f95 to
651039d
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/secret-providers.test.ts (1)
1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the duplicated "wait for provider-entered marker" logic into a shared helper.
Both sites implement the identical pattern:
waitForConditionwrapping areadFile(providerReadyPath, "utf8") === "provider-entered"check with ENOENT tolerance, differing only in the description string. Extracting a helper (e.g.waitForProviderEntered(providerReadyPath, description)) removes the duplication and gives future marker-boundary tests a single implementation to update.
tests/secret-providers.test.ts#L412-422: replace this inline block with a call to the shared helper.tests/secret-providers.test.ts#L1251-1261: replace this inline block with a call to the shared helper.♻️ Proposed helper
+async function waitForProviderEntered(providerReadyPath: string, description: string): Promise<void> { + await waitForCondition(async () => { + try { + return (await readFile(providerReadyPath, "utf8")) === "provider-entered"; + } catch (error) { + if (errorCode(error) === "ENOENT") return false; + throw error; + } + }, description); +}Then at each call site:
- await waitForCondition( - async () => { - try { - return (await readFile(providerReadyPath, "utf8")) === "provider-entered"; - } catch (error) { - if (errorCode(error) === "ENOENT") return false; - throw error; - } - }, - "the cold fake provider to enter through the Windows helper" - ); + await waitForProviderEntered(providerReadyPath, "the cold fake provider to enter through the Windows helper");🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/secret-providers.test.ts` at line 1, In tests/secret-providers.test.ts, extract the duplicated waitForCondition/readFile logic that waits for the "provider-entered" marker into a shared waitForProviderEntered(providerReadyPath, description) helper. Preserve ENOENT tolerance and the existing marker check, then replace both inline blocks near the referenced call sites with helper calls using their respective descriptions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@tests/secret-providers.test.ts`:
- Line 1: In tests/secret-providers.test.ts, extract the duplicated
waitForCondition/readFile logic that waits for the "provider-entered" marker
into a shared waitForProviderEntered(providerReadyPath, description) helper.
Preserve ENOENT tolerance and the existing marker check, then replace both
inline blocks near the referenced call sites with helper calls using their
respective descriptions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e5ddbf25-60af-445a-a5d6-ecb6a209641c
📒 Files selected for processing (2)
tests/fixtures/fake-secret-provider.mjstests/secret-providers.test.ts
Summary
Validation
Refs #115
Refs #125
Summary by CodeRabbit