Expand description
Test-mode setup the system tests drive through the mock Suotar control routes. Nothing here belongs on a live path: each helper writes a stamp or a hold the pipeline otherwise owns.
Functions§
- expire_
enrolment_ recheck_ allowance_ for_ testing - Backdates the row’s last enrolment check and last check request past the limit on asking, and the
row itself past the student’s first-hour wait, so a spec can press a recheck button without
waiting either out. With
clear_restarts, also forgets the day’s restarts. Exists only for test setup. - make_
enrolment_ checks_ due_ for_ testing - Makes every row in
scopethat waits for an enrolment check due now, as if its next rung had come, and returns how many it moved. Exists only for test setup: specs cannot wait out a day for a row’s first check. - set_
first_ failed_ at_ for_ testing - Backdates
first_failed_atfor a registration, so a test can simulate a retry window that started long enough ago for its retry limit to have elapsed. - set_
state_ entered_ at_ for_ testing - Backdates
state_entered_atfor a registration, so a test can simulate a row that has been sitting in its state long enough for a backoff or timeout to fire. - set_
test_ exclusive_ hold_ for_ testing - Excuses every one of a user’s rows (or, with
course_id, just that course’s) from every unscoped claim untilheld_until; a scoped claim ignores every hold regardless. Keyed on identity rather than a row id so a spec can hold before materialize creates the row it means to protect, closing the window a row-id hold could only ever narrow: the live background worker ticks every 10s regardless of any single test, so a hold applied after the row exists still races the worker’s own next tick.