Merged
Size
XS
Change Breakdown
Testing100%
#28182test: Fix flaky e2e tests in CI shards 2, 5, and 7 (no-changelog)

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): Added TEST_ISOLATION worker 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 intermediate toHaveCount(4/6/8) assertions that race against async log batching. The .nth(N).toContainText() assertions already auto-wait, and the final toHaveCount(10) validates completeness.
  • Shard 7 — n8nContainer null crash (sentry-baseline.spec.ts): Added missing @capability:kent tag to the describe title so the grepInvert filter properly excludes this container-only test in local mode.

CI failure evidence (from PR #27793 run)

  • Shard 2categories.spec.ts:82 "should show intro callout if user has not made a production execution" failed 3× (test + 2 retries)
  • Shard 5logs.spec.ts:56 toHaveCount(8) failed with 6 elements (async log batching race)
  • Shard 7sentry-baseline.spec.ts:6 n8nContainer.services crashed (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)
© 2026 · via Gitpulse