pub async fn set_test_exclusive_hold_for_testing(
conn: &mut PgConnection,
user_id: Uuid,
course_id: Option<Uuid>,
held_until: DateTime<Utc>,
) -> ModelResult<()>Expand description
Excuses every one of a user’s rows (or, with course_id, just that course’s) from every
unscoped claim until held_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.
Exists only for test setup: nothing in the product ever needs to hide a user’s rows from the worker that owns them.