62 lines
2.2 KiB
Markdown
62 lines
2.2 KiB
Markdown
---
|
|
id: suite-harness-current-thread
|
|
name: Contract-suite harness — async sleep in `past_stamp_sleep`, current-thread flavor readiness
|
|
status: pending
|
|
depends_on: []
|
|
scope: narrow
|
|
risk: low
|
|
impact: component
|
|
level: implementation
|
|
tags: [wave-6, contract-suite]
|
|
---
|
|
|
|
## Description
|
|
|
|
The one suite-side change wave 6 carries
|
|
([ADR-024](../architecture/decisions/024-mem-engine.md) §5 item 4; the
|
|
review-003 posture note at `properties.rs:1683`): the suite's
|
|
`past_stamp_sleep` helper uses a blocking `std::thread::sleep` inside
|
|
async rows — safe under the multi-thread test flavors both existing
|
|
engines' targets use, but it would stall a current-thread runtime. The
|
|
mem engine's suite column **must** run under a current-thread flavor
|
|
(`#[tokio::test(flavor = "current_thread")]`) to keep the mem
|
|
engine's internals honestly current-thread-clean — which is what
|
|
wasm32 needs.
|
|
|
|
- Replace `past_stamp_sleep`'s blocking sleep with `tokio::time::sleep`
|
|
(async). The helper's semantics are unchanged (a bounded
|
|
pre-`run_at` settle before reads); the existing rows' determinism
|
|
posture is untouched — verify the two legs using it re-run green on
|
|
both engines with no timing drift (tolerances unchanged).
|
|
- Document (one line in the helper's doc comment or the factory
|
|
contract notes) the harness posture: **no blocking calls inside
|
|
suite rows** — the mem column enforces the flavor that catches
|
|
violations.
|
|
|
|
This task is engine-independent and can run any time before
|
|
`mem-engine-integration` wires the third column.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] `past_stamp_sleep` is async (`tokio::time::sleep`)
|
|
- [ ] 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
|
|
determinism posture is documented
|
|
- [ ] Clippy `-D warnings`, fmt clean; workspace gates green
|
|
|
|
## References
|
|
|
|
- docs/architecture/decisions/024-mem-engine.md §5
|
|
- docs/reviews/003-wave-5-general-review.md §Finding 5 (the
|
|
`properties.rs:1683` posture note)
|
|
- docs/architecture/decisions/022-contract-suite-layout.md (the
|
|
factory contract the flavor rides)
|
|
|
|
## Notes
|
|
|
|
> To be filled by implementation agent
|
|
|
|
## Summary
|
|
|
|
> To be filled on completion |