mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
The scope-fence test asserts that a refused section leaves a sharing.access.denied audit row naming the reason. That row is written without being awaited, on purpose, so the audit never delays the 403 the caller is waiting on, and it lands some time after the response returns. The test bridged that gap with a fixed 150 ms sleep, which a slow runner outran: the read found an empty table and the assertion reported no refusal, which reads exactly like the section having reached the wire, the one thing this file exists to catch. The positive case now polls for the row and fails with a message naming the caller when none arrives within five seconds. The absence case keeps a fixed wait, longer than before, because an absence claim is only worth something if it waited. Proven by dropping the audit write behind an env flag: eleven cases fail with the new message, and pass again with the write restored.