Skip to content

ci: E2E waits until the Kafka consumer groups are stable - #398

Merged
HardMax71 merged 1 commit into
mainfrom
ci/e2e-wait-for-consumer-groups
Oct 18, 2026
Merged

HardMax71 merged 1 commit into
mainfrom
ci/e2e-wait-for-consumer-groups

Conversation

@HardMax71

@HardMax71 HardMax71 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Small bug found while checking main's CI after #396: run 39171533369 failed two execution tests on a 30 s timeout. The worker's consumer groups spent 38 s rebalancing, and "FastStream app started successfully!" only came at 22:20:51. The tests submitted around 22:20:50, and the first saga of the run started at 22:21:20. On a fresh Kafka the saga group starts at the newest message, so a request sent before it joins is never read.

Changes

After the backend health check, e2e-ready waits until k8s-worker, result-processor, saga-orchestrator, notification-service and sse-bridge-pool report Stable in kafka-consumer-groups --describe --state, up to 120 s each, and prints every group's state if one never gets there. cicd.md says why. Production keeps its committed offsets across restarts, so the app code stays as is.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or tooling changes

Test Plan

  • Backend unit tests pass (cd backend && uv run pytest tests/unit)
  • Frontend unit tests pass (cd frontend && npm run test)
  • Backend E2E tests pass (docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')
  • Frontend E2E tests pass (cd frontend && npm run test:e2e)
  • API spec and client regenerated if routes or schemas changed (./deploy.sh openapi, then ./deploy.sh types), never edited by hand
  • Manual testing performed

Validation: the same loop against a local Kafka with a fresh worker saw k8s-worker Stable after 11 s, result-processor after 24 s and saga-orchestrator after 41 s. This PR's own E2E jobs run the new step.

Checklist

  • My code follows the project's style guidelines
  • I have run pre-commit run --all-files and all checks pass
  • I have added tests that prove my fix/feature works
  • I have updated documentation if needed
  • My changes don't introduce new warnings

Summary by cubic

Fixes flaky E2E runs where execution tests timed out because they submitted requests while Kafka consumer groups were still joining. On a fresh Kafka most groups start at the newest message, so a request sent before they join is never read.

e2e-ready now waits for k8s-worker, result-processor, saga-orchestrator, notification-service, and sse-bridge-pool to report Stable in kafka-consumer-groups --describe --state (up to 120 s each) and prints every group's state if one never gets there. docs/operations/cicd.md explains why this is needed.

Written for commit 6cf18b5. Summary will update on new commits.

View guided diff Turn on auto-fix

On CI's fresh Kafka the saga, k8s-worker, notification and SSE groups start at the newest message, and the worker's groups took 38 s to join in run 39171533369. Two execution tests submitted in that window, their requests were never read, and they timed out. e2e-ready now waits for all five groups to report Stable before tests start, and prints every group's state if one doesn't within 120 s.
@HardMax71
HardMax71 enabled auto-merge (squash) October 18, 2026 22:50
@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 84d8b6f2-f52f-487a-9eee-0d8327ff8135
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area: ci GitHub workflows, test infrastructure, repo tooling labels Oct 18, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
backend-e2e 82.85% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

Components Coverage Δ
Backend 91.97% <ø> (+0.01%) ⬆️
Frontend 92.60% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HardMax71
HardMax71 merged commit 44a494c into main Oct 18, 2026
35 of 37 checks passed
@HardMax71
HardMax71 deleted the ci/e2e-wait-for-consumer-groups branch October 18, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci GitHub workflows, test infrastructure, repo tooling documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants