Repository navigation
ci: E2E waits until the Kafka consumer groups are stable - #398
Conversation
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.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
|
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|



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-serviceandsse-bridge-poolreportStableinkafka-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
Test Plan
cd backend && uv run pytest tests/unit)cd frontend && npm run test)docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e')cd frontend && npm run test:e2e)./deploy.sh openapi, then./deploy.sh types), never edited by handValidation: the same loop against a local Kafka with a fresh worker saw
k8s-workerStable after 11 s,result-processorafter 24 s andsaga-orchestratorafter 41 s. This PR's own E2E jobs run the new step.Checklist
pre-commit run --all-filesand all checks passSummary 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-readynow waits fork8s-worker,result-processor,saga-orchestrator,notification-service, andsse-bridge-poolto reportStableinkafka-consumer-groups --describe --state(up to 120 s each) and prints every group's state if one never gets there.docs/operations/cicd.mdexplains why this is needed.Written for commit 6cf18b5. Summary will update on new commits.