Runs the corpus timers on an Oban queue - #154
Merged
Merged
Conversation
Every delivery case now runs a second time with its timers on a real timer queue: each delayed send is scheduled, each cancel taken and each due job fired through statifier_oban, on an Oban instance in the suite's Postgres database. The runner moves each job's fire time onto its own clock and drains the queue one job at a time, so a job a fired send cancels is off the queue before it is read again. Both runs compare against the same expected. statifier_oban enters as a test-only dependency; mix.lock gains oban and statifier_oban and moves no existing version. Oban's job table is one more bootstrap migration, pinned at V14. Refs: sr-uckn
johnnyt
force-pushed
the
sr-uckn-corpus-timers-on-oban
branch
from
October 2, 2026 10:31
ad619e2 to
499ae87
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The routing corpus now runs every delivery case a second time with its timers on a real timer queue.
CorpusRunner.run/2takestimers: :oban: each delayed send is scheduled withStatifierOban.Timer.schedule/3under its execution's id, each cancel isStatifierOban.Timer.cancel/3, and each due job is fired by draining the Oban queue, reaching its execution through a process-less host'sStatifierOban.Timer.Delivery(StatifierRouter.CorpusTimerDelivery). The Oban instance runs in manual testing mode on the suite's own repo and Postgres database. Both runs compare against the sameexpected.Two choices in the runner, both test-only:
scheduled_atonto its own clock (the time the send was handed over on that clock, plus its delay), so a job falls due when the case's clock says so.with_limit: 1), earliest due first, so a job that a fired send cancels is off the queue before the queue is read again.with_safety: falseraises a failing delivery in the test rather than leaving it as a retry.The delivery cases, enumerated by
CorpusRunner.delivery_case_paths/0(every case undercorpus/cases/but the publish cases): click-then-impression, click-then-orphan-timeout, grace-click-after-expiry, impression-then-click, impression-then-expiry, reaped-address-drop, redelivered-impression, two-clicks-for-one-impression. All eight are green in both run modes.Dependency
statifier_oban enters ONLY as a test dependency (
only: :test); no runtime dependency is added, and nothing underlib/changes. Ruled by the operator, 2026-10-01.Before adding it, statifier_oban 0.17.0's Hex requirements were read against this lock:
statifier ~> 2.5(lock: 2.10.0),statifier_persistence ~> 0.13, optional (lock: 0.18.0),telemetry ~> 1.3(lock: 1.4.2),oban ~> 2.19(new).git diff origin/main -- mix.lockadds two lines and changes no existing line:Oban's job table is one more row in the suite's bootstrap migrations (
StatifierRouter.BootstrapMigrations), pinned at Oban's migration V14. The live migration tests own their own schema and do not see it; the isolated stage stays green.Sabotage
Each mutation was run against the corpus test module, restored from a copy (byte-equal), recompiled, and re-run green:
Timer.cancel/3. Red on an assertion: impression-then-click, click-then-impression, redelivered-impression, two-clicks-for-one-impression (Oban run mode).run/2made to ignoretimers:. Red on an assertion: "the Oban run mode fires its timers as jobs on the queue" (no job on the queue); every case green, which is why that test exists.delivery_case_paths/0made to keep the publish cases. Red on an assertion: "the Oban run mode runs every case but a publish case".Provenance
corpus/README.md(a gated path the file map did not name) gains one paragraph saying the runner plays the host twice, so its "The runner plays the host" section stays a complete description.fire/2intoCorpusRunner.step_fired/4, shared by both run modes.No changelog fragment: a test harness change with no public surface (
changelog.d/README.md).Gate
Full
mix qualitygreen on the rebased head (446 of 446 tests, isolated stage green).