Skip to content

test: the DLQ repository tests delete the rows they insert - #418

Merged
HardMax71 merged 1 commit into
mainfrom
fix/dlq-repository-test-cleanup
Oct 19, 2026
Merged

HardMax71 merged 1 commit into
mainfrom
fix/dlq-repository-test-cleanup

Conversation

@HardMax71

@HardMax71 HardMax71 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Small bug found while checking the DLQ span metrics. Two tests in test_dlq_repository.py insert DLQ rows on topics t1 and t2 and never delete them. After one e2e run the shared database kept 6 of them, so the worker's DLQ size job reports t1 = 3 and t2 = 1 until the 7-day TTL runs out.

Changes

The inserts become fixtures that yield and then delete their rows by event id, the way failed_event in tests/e2e/dlq/test_dlq_manager.py already does.

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: ruff and mypy --strict pass; the Backend E2E job runs both tests against the real stack.

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 the DLQ repository e2e tests leaving inserted rows behind, which inflated the worker's DLQ size job metrics for topics t1 and t2 until the 7-day TTL expired.

  • Converts the test row inserts into fixtures that delete their rows by event id after each test finishes.
  • Follows the same cleanup pattern already used in test_dlq_manager.py.

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

View guided diff Turn on auto-fix

@HardMax71
HardMax71 enabled auto-merge (squash) October 19, 2026 21:44
@coderabbitai

coderabbitai Bot commented Oct 19, 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: 35d32cab-8df1-45a6-b3b4-f7bbabd5c6de
  • 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.

@sonarqubecloud

Copy link
Copy Markdown

@codecov-commenter

codecov-commenter commented Oct 19, 2026 •

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.70% <ø> (ø)
backend-unit 74.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Backend 92.46% <ø> (ø)
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 c8b6960 into main Oct 19, 2026
21 checks passed
@HardMax71
HardMax71 deleted the fix/dlq-repository-test-cleanup branch October 19, 2026 21:50
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.

2 participants