diff --git a/yarn-project/end-to-end/src/spartan/utils.ts b/yarn-project/end-to-end/src/spartan/utils.ts index 1e5fd64145b3..4530c0455942 100644 --- a/yarn-project/end-to-end/src/spartan/utils.ts +++ b/yarn-project/end-to-end/src/spartan/utils.ts @@ -350,7 +350,11 @@ export async function awaitL2BlockNumber( await sleep(1000); tips = await rollupCheatCodes.getTips(); } - logger.info(`Reached L2 Block ${tips.pending}`); + if (Date.now() >= endTime) { + throw new Error(`Timeout waiting for L2 Block ${blockNumber}`); + } else { + logger.info(`Reached L2 Block ${tips.pending}`); + } } export async function restartBot(namespace: string, logger: Logger) {