suite: async past_stamp_sleep for current-thread flavor readiness

Replace the harness's blocking std::thread::sleep with tokio::time::sleep
across all nine call sites, note the no-blocking-calls-inside-rows posture
in the helper's doc comment, and mark the task completed. Both engines'
contract suites re-run green with assertions and tolerances unchanged
(ADR-024 \u00a75 item 4).
This commit is contained in:
glm-5.3-flash committed 2026-10-10 11:11:09 +00:00
1 parent a48c12745a
commit 6f9cfb5778
2 files changed
+44 -18

No files matched your search

+27 -7
View File
@@ -1,7 +1,7 @@
---
id: suite-harness-current-thread
name: Contract-suite harness — async sleep in `past_stamp_sleep`, current-thread flavor readiness
status: pending
status: completed
depends_on: []
scope: narrow
risk: low
@@ -38,12 +38,12 @@ This task is engine-independent and can run any time before
## Acceptance Criteria
- [ ] `past_stamp_sleep` is async (`tokio::time::sleep`)
- [ ] Both engines' existing suites re-run green with identical
- [x] `past_stamp_sleep` is async (`tokio::time::sleep`)
- [x] Both engines' existing suites re-run green with identical
assertions and tolerances (determinism posture intact)
- [ ] The no-blocking-calls posture noted where the harness's
- [x] The no-blocking-calls posture noted where the harness's
determinism posture is documented
- [ ] Clippy `-D warnings`, fmt clean; workspace gates green
- [x] Clippy `-D warnings`, fmt clean; workspace gates green
## References
@@ -55,8 +55,28 @@ This task is engine-independent and can run any time before
## Notes
> To be filled by implementation agent
- The posture note went into `past_stamp_sleep`'s doc comment rather
than the factory contract notes: the posture is a harness rule about
row internals (what a row may call), not part of the
`StoreFactory` shape, and the doc comment sits exactly where a row
author reaches for a sleep. The comment cites ADR-024 §5 for the
current-thread flavor that enforces it.
- Five rows exercise the helper across its two use shapes (the
lapse-settle legs and the scheduler runner-less-pause leg):
`lock_ttl_expiry_and_reacquisition`, `job_handle_validity_predicate`,
`queue_depth_reclaim_and_dead_letter`, `sweep_no_stranded_rows`,
`scheduler_bounded_catchup`. All nine call sites gained `.await`;
assertions and tolerances untouched.
## Summary
> To be filled on completion
`past_stamp_sleep` now awaits `tokio::time::sleep` instead of blocking
on `std::thread::sleep` (alkstore-contract-suite/src/properties.rs),
making every suite row current-thread-safe for the mem engine's
`#[tokio::test(flavor = "current_thread")]` column (ADR-024 §5 item 4);
the doc comment records the no-blocking-calls-inside-rows posture.
Both engines' `contract_suite` re-ran fully green (25/25 each, SQLite
15.0 s / Postgres 21.3 s — no timing drift, tolerances unchanged); the
full workspace build, tests, `clippy -D warnings`, and `fmt --check`
pass. PostgreSQL leg ran against the POC container (`pglo-poc`, port
15432, creds per docs/reviews/003 §env note).