Skip to content

Commit 6d7dbaa

Browse files
committed
[runtime] make schema chain test deterministic
Why: ensure the end-to-end signing chain test follows cached-only validator warmup behavior in CI instead of hanging on cold schema startup. Contract impact: none
1 parent 512172b commit 6d7dbaa

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

runtime/tests/runtime-signing.test.mjs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,10 @@ test("full chain clean -> summarize -> classify verifies with schema using parti
436436
RECEIPT_SIGNING_PRIVATE_KEY_PEM_B64: keys.privatePemB64,
437437
RECEIPT_SIGNING_PUBLIC_KEY_B64: keys.publicRaw32B64,
438438
RECEIPT_SIGNER_ID: "runtime.commandlayer.eth",
439-
VERIFY_SCHEMA_CACHED_ONLY: "0",
440-
SCHEMA_FETCH_TIMEOUT_MS: "50",
439+
VERIFY_SCHEMA_CACHED_ONLY: "1",
440+
VERIFY_MAX_MS: "12000",
441+
SCHEMA_FETCH_TIMEOUT_MS: "3000",
442+
SCHEMA_VALIDATE_BUDGET_MS: "3000",
441443
});
442444

443445
async function runVerb(base, verb, content) {
@@ -530,11 +532,8 @@ test("full chain clean -> summarize -> classify verifies with schema using parti
530532
let verifyAttempt = await verifyReceiptWithTimeout(finalReceipt);
531533
console.log("[chain] after verify response", verifyAttempt.res.status, verifyAttempt.json ?? verifyAttempt.text);
532534

533-
if (
534-
verifyAttempt.res.status === 202
535-
&& verifyAttempt.json?.reason === "validator_not_warmed_yet"
536-
) {
537-
console.log("[chain] verify warmup 202 response", verifyAttempt.json);
535+
if (verifyAttempt.res.status === 202) {
536+
console.log("[chain] verify warmup 202 response", verifyAttempt.json ?? verifyAttempt.text);
538537
await new Promise((resolve) => setTimeout(resolve, 1200));
539538
console.log("[chain] before verify request retry");
540539
verifyAttempt = await verifyReceiptWithTimeout(finalReceipt);
@@ -545,7 +544,11 @@ test("full chain clean -> summarize -> classify verifies with schema using parti
545544
const verifyJson = verifyAttempt.json;
546545

547546
assert.ok(verifyJson, "verify returned non-JSON response");
548-
assert.equal(verifyRes.status, 200);
547+
548+
if (verifyRes.status !== 200) {
549+
throw new Error(`verify retry failed with status ${verifyRes.status}: ${verifyAttempt.text}`);
550+
}
551+
549552
assert.equal(verifyJson.checks.signature_valid, true);
550553
assert.equal(verifyJson.checks.hash_matches, true);
551554
assert.equal(verifyJson.checks.schema_valid, true);

0 commit comments

Comments
 (0)