Skip to content

Commit b5d0239

Browse files
committed
fix(fhevm-cli): retry discoverSigner fetch and log ensureMaterialUrl HTTP status
1 parent 8242fd4 commit b5d0239

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

test-suite/fhevm/src/runtime.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,17 @@ const discoverSigner = async (deps: RuntimeDeps) => {
473473
const logs = await deps.runner(["docker", "logs", "kms-core"], { allowFailure: true });
474474
const match = logs.stdout.match(/handle ([a-zA-Z0-9]+)/) ?? logs.stderr.match(/handle ([a-zA-Z0-9]+)/);
475475
if (match) {
476-
const response = await deps.fetch(`http://localhost:9000/kms-public/PUB/VerfAddress/${match[1]}`);
477-
if (!response.ok) {
478-
throw new Error(`Could not fetch KMS signer address (HTTP ${response.status})${await responseSnippet(response)}`);
476+
try {
477+
const response = await deps.fetch(`http://localhost:9000/kms-public/PUB/VerfAddress/${match[1]}`);
478+
if (!response.ok) {
479+
throw new Error(`Could not fetch KMS signer address (HTTP ${response.status})${await responseSnippet(response)}`);
480+
}
481+
return (await response.text()).trim();
482+
} catch (error) {
483+
if (shouldLogRetry(attempt)) {
484+
log(`[wait] kms signer fetch: ${toError(error).message}`);
485+
}
479486
}
480-
return (await response.text()).trim();
481487
}
482488
if (shouldLogRetry(attempt)) {
483489
log("[wait] kms signer handle");
@@ -651,6 +657,9 @@ const ensureMaterialUrl = async (deps: RuntimeDeps, url: string) => {
651657
if (response.ok) {
652658
return;
653659
}
660+
if (shouldLogRetry(attempt)) {
661+
log(`[wait] material: HTTP ${response.status}`);
662+
}
654663
} catch (error) {
655664
// network not ready yet (ECONNREFUSED, DNS, etc.) — retry
656665
if (shouldLogRetry(attempt)) {

0 commit comments

Comments
 (0)