diff --git a/apps/entropy-tester/package.json b/apps/entropy-tester/package.json index 4d687a410f..5b46ca3454 100644 --- a/apps/entropy-tester/package.json +++ b/apps/entropy-tester/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/entropy-tester", - "version": "1.0.1", + "version": "1.0.2", "description": "Utility to test entropy provider callbacks", "type": "module", "main": "dist/index.js", diff --git a/apps/entropy-tester/src/index.ts b/apps/entropy-tester/src/index.ts index a08972095f..815812c8f1 100644 --- a/apps/entropy-tester/src/index.ts +++ b/apps/entropy-tester/src/index.ts @@ -181,7 +181,18 @@ export const main = function () { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition while (true) { try { - await testLatency(contract, privateKey, child); + await Promise.race([ + testLatency(contract, privateKey, child), + new Promise((_, reject) => + setTimeout(() => { + reject( + new Error( + "Timeout: 120s passed but testLatency function was not resolved", + ), + ); + }, 120_000), + ), + ]); } catch (error) { child.error(error, "Error testing latency"); }