diff --git a/tests/e2e.rs b/tests/e2e.rs index 4a98221..407fbe0 100644 --- a/tests/e2e.rs +++ b/tests/e2e.rs @@ -1371,6 +1371,10 @@ async fn exam_room_close_after_a_retake_leaves_the_new_sitting_alone() { assert_eq!(body["attempt"], 2); // Now walk out of the stale sitting-#1 room and give the teardown time. + // race-window staging — do not convert to poll: sitting #1 is terminal, so + // the teardown stamps nothing at all (`stamp_left` writes only an + // in-progress sitting), and the assertion below is that *no* stamp lands on + // sitting #2 — a negative with no positive to wait on. ws.close(None).await.unwrap(); tokio::time::sleep(std::time::Duration::from_millis(500)).await; diff --git a/tests/regress_course_delete.rs b/tests/regress_course_delete.rs index ed30838..cec189a 100644 --- a/tests/regress_course_delete.rs +++ b/tests/regress_course_delete.rs @@ -221,6 +221,7 @@ async fn an_attempt_started_inside_a_course_delete_never_outlives_it() { .await }) }; + // race-window staging — do not convert to poll tokio::time::sleep(std::time::Duration::from_millis(300)).await; // The enrollment goes while the sitting is mid-write — the only staging in // which the delete is admitted at all. Without it this is a 409 and the diff --git a/tests/regress_exam_delete.rs b/tests/regress_exam_delete.rs index 17c2c3e..04a658e 100644 --- a/tests/regress_exam_delete.rs +++ b/tests/regress_exam_delete.rs @@ -90,6 +90,7 @@ async fn an_attempt_started_inside_a_delete_never_outlives_the_exam() { }; // The start fires inside the held window: without the lease it reads an // exam row the delete has removed but not committed. + // race-window staging — do not convert to poll tokio::time::sleep(std::time::Duration::from_millis(300)).await; let sit = { let (app, student, exam) = (app.clone(), student.clone(), exam.clone()); diff --git a/tests/regress_homework_orphans.rs b/tests/regress_homework_orphans.rs index 343ad40..0560a2f 100644 --- a/tests/regress_homework_orphans.rs +++ b/tests/regress_homework_orphans.rs @@ -146,6 +146,7 @@ async fn an_upload_inside_a_homework_delete_never_orphans() { }; // The upload fires inside the held window: its gate reads a homework the // delete has removed but not committed. + // race-window staging — do not convert to poll tokio::time::sleep(std::time::Duration::from_millis(1_000)).await; let uploaded = { let (app, student, hw) = (app.clone(), student.clone(), hw.clone()); @@ -263,6 +264,7 @@ async fn an_upload_inside_an_audience_patch_is_refused() { .await }) }; + // race-window staging — do not convert to poll tokio::time::sleep(std::time::Duration::from_millis(1_000)).await; let uploaded = { let (app, cookie, hw) = (app.clone(), dropped_student.clone(), hw.clone()); @@ -511,6 +513,7 @@ async fn a_grade_inside_a_course_delete_never_orphans() { (res, started.elapsed()) }) }; + // race-window staging — do not convert to poll tokio::time::sleep(std::time::Duration::from_millis(1_000)).await; // The roster empties mid-grade — the only staging in which the course // delete is admitted at all. @@ -707,6 +710,7 @@ async fn a_file_add_racing_a_file_delete_never_500s() { }; // The upload commits on the submission row while the delete is still // holding its own write of it. + // race-window staging — do not convert to poll tokio::time::sleep(std::time::Duration::from_millis(40)).await; let added = upload_hw_file(&app, &student, &hw).await; let removed = removing.await.unwrap(); diff --git a/tests/regress_role_sweep.rs b/tests/regress_role_sweep.rs index 4858c01..3ff91b5 100644 --- a/tests/regress_role_sweep.rs +++ b/tests/regress_role_sweep.rs @@ -108,6 +108,7 @@ async fn demote_in_the_window( let (student, db) = (student.clone(), db.clone()); tokio::spawn(async move { demote(&student, to, &db).await }) }; + // race-window staging — do not convert to poll tokio::time::sleep(std::time::Duration::from_millis(400)).await; handle }