diff --git a/yarn-project/aztec.js/src/test/anvil_test_watcher.ts b/yarn-project/aztec.js/src/test/anvil_test_watcher.ts index f4f7aa4b3fb1..0a7d97cfbb1c 100644 --- a/yarn-project/aztec.js/src/test/anvil_test_watcher.ts +++ b/yarn-project/aztec.js/src/test/anvil_test_watcher.ts @@ -70,11 +70,11 @@ export class AnvilTestWatcher { const isAutoMining = await this.cheatcodes.isAutoMining(); if (isAutoMining) { - this.filledRunningPromise = new RunningPromise(() => this.warpTimeIfNeeded(), this.logger, 1000); + this.filledRunningPromise = new RunningPromise(() => this.warpTimeIfNeeded(), this.logger, 200); this.filledRunningPromise.start(); - this.mineIfOutdatedPromise = new RunningPromise(() => this.mineIfOutdated(), this.logger, 1000); + this.mineIfOutdatedPromise = new RunningPromise(() => this.mineIfOutdated(), this.logger, 200); this.mineIfOutdatedPromise.start(); - this.markingAsProvenRunningPromise = new RunningPromise(() => this.markAsProven(), this.logger, 1000); + this.markingAsProvenRunningPromise = new RunningPromise(() => this.markAsProven(), this.logger, 200); this.markingAsProvenRunningPromise.start(); this.logger.info(`Watcher started for rollup at ${this.rollup.address}`); } else { @@ -88,6 +88,12 @@ export class AnvilTestWatcher { await this.markingAsProvenRunningPromise?.stop(); } + async trigger() { + await this.filledRunningPromise?.trigger(); + await this.mineIfOutdatedPromise?.trigger(); + await this.markingAsProvenRunningPromise?.trigger(); + } + async markAsProven() { if (!this.isMarkingAsProven) { return; diff --git a/yarn-project/end-to-end/src/e2e_fees/failures.test.ts b/yarn-project/end-to-end/src/e2e_fees/failures.test.ts index 7e083a4c27a3..4de0718acae6 100644 --- a/yarn-project/end-to-end/src/e2e_fees/failures.test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/failures.test.ts @@ -34,6 +34,7 @@ describe('e2e_fees failures', () => { // Prove up until the current state by just marking it as proven. // Then turn off the watcher to prevent it from keep proving + await t.context.watcher.trigger(); await t.cheatCodes.rollup.advanceToNextEpoch(); await t.catchUpProvenChain(); t.setIsMarkingAsProven(false); @@ -77,6 +78,7 @@ describe('e2e_fees failures', () => { await expectMapping(t.getGasBalanceFn, [aliceAddress, bananaFPC.address], [initialAliceGas, initialFPCGas]); // We wait until the proven chain is caught up so all previous fees are paid out. + await t.context.watcher.trigger(); await t.cheatCodes.rollup.advanceToNextEpoch(); await t.catchUpProvenChain(); @@ -97,6 +99,7 @@ describe('e2e_fees failures', () => { // @note There is a potential race condition here if other tests send transactions that get into the same // epoch and thereby pays out fees at the same time (when proven). + await t.context.watcher.trigger(); await t.cheatCodes.rollup.advanceToNextEpoch(); await t.catchUpProvenChain();