Three flaky CI tests stabilized across shards 2, 5, and 7
Three e2e tests that repeatedly failed in CI have been patched — fixing database isolation, removing brittle async assertions, and adding a missing capability tag that caused crashes.
CI reliability hinges on tests that actually pass. Three e2e tests in the n8n test suite were failing intermittently across shards 2, 5, and 7, wasting CI minutes on retries and eroding confidence in the test suite. In shard 2, the activation callout test was picking up database state from other tests that had already activated a user — a classic test isolation problem. In shard 5, three intermediate assertions checking log counts at specific intervals were racing against async batching, sometimes seeing 6 elements when 8 were expected. In shard 7, a container-only test was crashing because a capability tag was missing from its describe block, causing the local-mode filter to try running it anyway. All three issues are now resolved: the categories test uses worker-level test isolation for a fresh database, the logs test relies on its auto-waiting assertions without counting intermediate batches, and the sentry test carries the kent capability tag. The e2e suite should now run cleanly without retries.
View Original GitHub Description
Summary
Fixes 3 flaky e2e test failures observed in PR #27793 CI:
- Shard 2 — Activation callout not found (
categories.spec.ts): AddedTEST_ISOLATIONworker isolation so the file gets a fresh DB where no user has been activated by other tests. - Shard 5 — Brittle intermediate log counts (
logs.spec.ts): Removed 3 intermediatetoHaveCount(4/6/8)assertions that race against async log batching. The.nth(N).toContainText()assertions already auto-wait, and the finaltoHaveCount(10)validates completeness. - Shard 7 — n8nContainer null crash (
sentry-baseline.spec.ts): Added missing@capability:kenttag to the describe title so thegrepInvertfilter properly excludes this container-only test in local mode.
CI failure evidence (from PR #27793 run)
- Shard 2 —
categories.spec.ts:82"should show intro callout if user has not made a production execution" failed 3× (test + 2 retries) - Shard 5 —
logs.spec.ts:56toHaveCount(8)failed with 6 elements (async log batching race) - Shard 7 —
sentry-baseline.spec.ts:6n8nContainer.servicescrashed (null reference, all 3 sentry tests failed 3× each)
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/GHC-7520
Review / Merge checklist
- PR title and summary are descriptive. (conventions)
- Docs updated or follow-up ticket created.
- Tests included.
- PR Labeled with
release/backport(if the PR is an urgent fix that needs to be backported)