You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(e2e): event-driven harness with per-controller parking and deterministic cancel test
Rework the SubmitQueue e2e suite so tests block on signals the pipeline
pushes to them instead of polling with hard-coded timeouts, add a
per-controller parking primitive so any pipeline stage can be starved
deterministically, and add a cancellation test that deterministically
reaches the terminal "cancelled" state.
- Queue observer (observer_test.go): test-owned consumer groups subscribe
to the log topic and runway's check/signal topics over the published
mysql-queue port. Delivery state is keyed per consumer group, so the
observer receives a copy of every message without stealing from the
services and without any service changes. Tests await pushed events
(status transitions, runway's answers on the wire).
- No hard-coded timeouts: every wait is bounded by a suite context whose
deadline derives from the test binary deadline (Bazel test timeout)
minus a teardown margin. The old persistTimeout constant is gone; the
remaining polls (Status RPC and request_log, both eventually consistent
behind the gateway log consumer) run at a fixed cadence under that
context.
- StageHold (testutil/stagehold.go): parks any single queue consumer
controller with zero service changes by planting a phantom partition
lease (far-future lease_renewed_at) in the MySQL queue's
partition-leases table for (consumer_group, topic, partition_key). The
plain INSERT fails loudly if the partition is already leased, so holds
must be planted before the stage first consumes (pre-hold contract).
Release() deletes the row (idempotent after success, retryable on
failure) and consumption resumes on the service's next discovery tick.
Held messages are never delivered, so parking has no retry-budget or
DLQ interaction.
- Stage catalog (stage_test.go): enumerates every queue consumer
controller across the three services — gateway (1), orchestrator
(12 primary + 12 DLQ), and runway (2) — with a holdStage() suite
helper, so tests can starve any controller x partition.
- Lease-semantics contract test (integration, messagequeue/mysql):
pins the guarantees StageHold relies on — a held partition starves the
group's consumer while other partitions keep flowing, releasing the
hold resumes delivery, and Release is idempotent.
- Deterministic cancel test: park the request at the merge-conflict-check
boundary with a StageHold on runway's merge-conflict-check consumer
(partition = queue name) instead of stopping/starting the runway
container (confirmed by a pushed event), cancel, await the pushed
"cancelled" event, then assert the terminal store state, that no batch
ever enrolled the request, and that runway's late signal after the hold
is released does not resurrect it. The connectRunway re-dial helper is
gone: services start once in SetupSuite and stop once in TearDownSuite.
- Runway is now first-class in the suite: gRPC ping test, graceful
shutdown exit-code check, and happy-path assertions that runway
answered both the merge-conflict check and the merge with SUCCEEDED
(the merge signal must carry the request's step IDs — the assertion
that exposed the merge topic collision fixed in the parent commit).
- testutil: ComposeStack drops StartService — there is no on-demand
service start/stop mid-suite anymore (StopService is retained for the
graceful-shutdown verification in teardown); compose command prefers
docker compose V2 (the harness relies on V2-only "up --wait"); the
stack uses a background context so teardown outlives the suite wait
budget; TestLogger is safe for concurrent use.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments