Skip to content

test: finish sidebar lazy imports before teardown - #23694

Merged
nwparker merged 1 commit into
mainfrom
nwparker/ci-sidebar-import-teardown
Sep 28, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/ci-sidebar-import-teardown

Conversation

@nwparker

@nwparker nwparker commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2
Prod 0 0 0 0

ELI5

A sidebar test could pass all assertions but still fail CI because its markdown import finished after the test environment had been destroyed.

What Changed

Wait for pending dynamic imports during the existing cleanup, after unmounting the cards.

Why

The real agent rows start a lazy markdown import. Waiting for that work keeps the real components and all expansion assertions, without hiding imports behind mocks or increasing timeouts.

Linked Issue

Related CI failure on #23691.

Visual Proof

N/A — test cleanup only.

Testing

  • Automated tests updated: all five cases pass locally on macOS.
  • Changed-code quality gate passes.
  • CI covers the Linux unit shards and remaining checks.

Review

No application behavior changes; platform and SSH behavior are unchanged.

Agent skill upstream boundary

  • Not applicable.

Checklist

  • Small, focused, and self-reviewed.
  • Explained the failure, mechanism, and approach.
  • N/A visual proof with reason.
  • Cross-platform and remote impact considered.
  • Remaining validation covered by CI.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ae814846-dbe8-4836-85f3-d5838885f6da

📥 Commits

Reviewing files that changed from the base of the PR and between 55aea85 and 6ecf23a.

📒 Files selected for processing (1)
  • src/renderer/src/components/sidebar/WorktreeList.lineage-agent-expansion-coupling.test.tsx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Awaits pending lazy imports in test teardown — afterEach now calls await vi.dynamicImportSettled() after unmounting the mounted roots, so the lazily imported ./CommentMarkdown chunk resolves before the happy-dom module environment is torn down.

The fix is correct and well targeted. This test renders the real WorktreeCardAgents, which pull in DashboardAgentRowMessage → CommentMarkdownAsync (comment-markdown-lazy.tsx), whose effect calls preloadCommentMarkdown() (void import('./CommentMarkdown')). That chunk's evaluation racing environment teardown is exactly what vi.dynamicImportSettled() is for, and it exists in the installed Vitest ^4.1.11. vi is already imported, and the call sits correctly after unmount inside the existing act. No other test appears to exercise this markdown path, so there is no broader cleanup gap to flag.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Test teardown waits for lazy imports to settle.

The PR appears safe to merge.

Summary

The PR waits for pending dynamic imports during sidebar test cleanup, after unmounting the rendered roots. It does not change application behavior.

Reviews (1) · Last reviewed commit: "test: finish sidebar lazy imports before..."

@nwparker
nwparker merged commit 1a0ff42 into main Sep 28, 2026
37 checks passed
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