Commit dee854d
committed
test(queue/sql): add comprehensive e2e integration tests
Why?
The SQL queue implementation needs thorough integration testing against
a real MySQL database to validate end-to-end functionality including:
- Message publishing and consumption workflows
- Partition management and isolation
- Visibility timeout and retry mechanisms
- DLQ (Dead Letter Queue) handling
- Concurrency and crash recovery scenarios
- Consumer group coordination and load balancing
Without these tests, we cannot verify that the queue behaves correctly
in production-like scenarios with a real database.
What?
- Add 15 comprehensive integration tests using testcontainers-go:
* Basic operations: publish/subscribe, metadata preservation
* Partition management: multiple partitions, isolation
* Reliability: visibility timeout, retry, nack with delay
* Correctness: idempotent publish, message ordering
* Concurrency: concurrent publishers, concurrent subscribers
* Crash recovery: lease expiration and message recovery
* Consumer groups: multiple groups, multiple workers, load balancing
* DLQ: max retries, DLQ metadata, failure tracking
* Edge cases: late subscriber, empty topic, graceful shutdown
- Add integration_tests/queue/README.md with:
* Test coverage documentation
* Prerequisites (Docker)
* Running instructions (Bazel, go test, verbose output)
* Test descriptions and what each validates
- Refactor integration_tests/testutil for reusability:
* Extract MySQL container utilities to testutil/mysql.go
* Share MySQL setup across integration test suites
* Add schema application helpers
- Test infrastructure improvements:
* Use testify/suite for setup/teardown lifecycle
* Tag tests with "integration" for selective execution
* Support for verbose test output (--test_arg=-test.v)
* Proper container cleanup in all scenarios
All 15 tests passing in ~2 minutes runtime.
Co-Authored-By: Preetam Dwivedi <preetam@uber.com>1 parent 462f8e4 commit dee854d
9 files changed
Lines changed: 1415 additions & 161 deletions
File tree
- integration_tests
- queue
- testutil
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments