Skip to main content

Module control

Module control 

Source
Expand description

The mock Suotar control surface: test-only routes that are not part of Suotar’s API.

A tick runs one iteration of one phase synchronously, because the real loops are long-running intervals in their own Deployments that a Playwright spec cannot wait out. Gated on test_mode && test_suotar, so no token; the client is hand-written in system-tests/src/utils/suotarControl.ts.

Structs§

QueuedEmail
QueuedEmailsQuery
RegistrarTickResult
One entry per phase in the sequence, in the order they ran.
RegradeCompletionPayload
RegradeCompletionResult
RunTickQuery
SetTestExclusiveHoldPayload
SetTestExclusiveHoldResult
UnresolvedScope

Enums§

PhaseTickResult

Constants§

MAX_TEST_EXCLUSIVE_HOLD_SECS 🔒
Comfortably above Playwright’s own 100 s per-test timeout (playwright.config.ts’s timeout), so no legitimate hold is ever rejected; a value anywhere near this is a spec that mistyped a unit, not one that needs the identity held that long.
QUEUED_EMAIL_SCAN 🔒
How many of an account’s mails one read looks back over. Generous: the shared test database has a live pipeline queueing mail for everybody, and a short window would turn “exactly one” into a false pass.

Functions§

_add_routes
known_phase_names 🔒
queued_emails 🔒
The mails queued to one account, newest first. There is no mail capture in this repo, so a spec asserting a message was composed reads the send queue instead of an inbox.
regrade_completion 🔒
Rewrites the grade of the completion behind one ledger row.
resolve_scope 🔒
The outer error is a real failure; the inner one is a scope half that names nothing.
run_registrar_tick 🔒
The combined form of run-tick, walking the sequence in pipeline order. Always 200; each phase reports its own status. Takes no scope on purpose: a suite that only ever ticks scoped never exercises the sweep-everything behaviour production has.
run_tick 🔒
Runs one iteration of one pipeline phase: 200 when it ran, 400 for unknownPhase or a scope the phase cannot narrow on. An optional scope narrows the rows the iteration may claim; absent is unscoped, which is what production does.
set_test_exclusive_hold 🔒
Excuses a user’s rows from the live background worker’s unscoped sweeps — see credit_registrations::set_test_exclusive_hold_for_testing. Keyed on identity rather than a row id, so a spec can hold before materialize creates the row it means to protect.
tick_context 🔒
Attributed to the tick rather than to a worker, so the audit log says which traffic a test made.