Skip to content

Skipped flaky cache-invalidation unit test under vitest#28049

Merged
9larsons merged 1 commit into
mainfrom
fix/skip-flaky-cache-invalidation-test
May 21, 2026
Merged

Skipped flaky cache-invalidation unit test under vitest#28049
9larsons merged 1 commit into
mainfrom
fix/skip-flaky-cache-invalidation-test

Conversation

@9larsons
Copy link
Copy Markdown
Contributor

@9larsons 9larsons commented May 21, 2026

The cache-invalidation unit test cold-require()s every endpoint controller inside a single test body. Under vitest's per-file module isolation each test file gets a fresh module registry, so this test pays the full cold-import cost of a large slice of Ghost on its own — and that intermittently exceeds the 2000ms testTimeout on loaded CI runners, currently breaking main.

This skips the test to unblock CI. It's a deliberate, temporary measure: the test is restored as part of moving ghost/core's unit suite to a shared module registry (isolate: false), where the controller require()s are warm and the test runs well under the timeout.

- the test cold-requires every endpoint controller in a single test body;
  under vitest's per-file module isolation that intermittently exceeds the
  2000ms testTimeout on loaded CI runners, which is currently breaking main
- skipping unblocks CI now; the test is restored when ghost/core's unit
  suite moves to a shared module registry (isolate: false), where the
  controller requires are warm and fast
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 41e29c83-3a15-43a0-8d48-b9d0766edffa

📥 Commits

Reviewing files that changed from the base of the PR and between 263ee04 and 251c439.

📒 Files selected for processing (1)
  • ghost/core/test/unit/api/cache-invalidation.test.js

Walkthrough

The PR temporarily disables a cache-invalidation test case by converting it to a skipped test with explanatory comments. The change adds a note that the skip is due to intermittent CI timeouts caused by per-file module isolation, and indicates the test should be restored once the Ghost unit suite uses a shared module registry. An eslint directive is added to allow the skipped test rule.

Possibly related PRs

  • TryGhost/Ghost#27900: Updates Vitest configuration and migrates unit tests to run under Vitest, directly related to the test-runner isolation workstream causing the timeout issues addressed in this PR.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: skipping a flaky cache-invalidation test under vitest.
Description check ✅ Passed The description clearly explains the reason for skipping the test, the underlying issue with vitest module isolation, and the temporary nature of this fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/skip-flaky-cache-invalidation-test

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 and usage tips.

@9larsons 9larsons enabled auto-merge (squash) May 21, 2026 17:26
@9larsons 9larsons merged commit f7ff367 into main May 21, 2026
27 checks passed
@9larsons 9larsons deleted the fix/skip-flaky-cache-invalidation-test branch May 21, 2026 17:33
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