From 3e158e31d7221bd0a667b52633d586a39e8892fd Mon Sep 17 00:00:00 2001 From: M3gA-Mind Date: Wed, 11 Nov 2026 18:17:49 +0530 Subject: [PATCH] test(audit): give the native audit example a timeout its reinit phase fits The generation-race phase reinitializes the module inside the audit callback. On a loaded macOS runner that took about 107 ms, past the fixture's 100 ms audit wait, so the receipt was never committed and the example failed intermittently. One module serves every phase and its audit settings are immutable across reinit, so raise the shared wait to 1000 ms. The never-replying phase still times out well inside the 3 s client wait. --- .../tinysecurity-module/examples/audit_native_contract.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/tinysecurity-module/examples/audit_native_contract.rs b/crates/tinysecurity-module/examples/audit_native_contract.rs index 74fff5b2..8811c16e 100644 --- a/crates/tinysecurity-module/examples/audit_native_contract.rs +++ b/crates/tinysecurity-module/examples/audit_native_contract.rs @@ -152,6 +152,12 @@ impl Interface for Callback { Ok(reply) } } +/// Audit sink wait. One module serves every phase, and its audit settings are +/// immutable across reinit, so this one value has to fit them all. Mode 6 +/// reinitializes the module inside the callback, which took about 107 ms on a +/// loaded macOS runner, past the 100 ms this used to be; mode 3 deliberately +/// never replies and must still time out well inside the 3 s client wait. +const AUDIT_TIMEOUT_MS: u32 = 1000; fn audit_config(required: bool) -> AuditConfig2 { AuditConfig2 { scope: SubjectScope { @@ -160,7 +166,7 @@ fn audit_config(required: bool) -> AuditConfig2 { agent: "agent".into(), }, stream_id: "a".repeat(32), - timeout_ms: 100, + timeout_ms: AUDIT_TIMEOUT_MS, required, native_path: None, max_bytes: 10000,