Skip to content

Commit c485cb8

Browse files
authored
chore: Deflake e2e_l1_publisher test (#19203)
We were getting errors stopping anvil at the end of some tests. This adds a try/catch around stopping anvil, and initializes each anvil instance in a different port to prevent a test from bleeding into the next if an anvil stop actually fails. Failed test run: http://ci.aztec-labs.com/109d17afbdad557d
2 parents 4c23b9d + a143b97 commit c485cb8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

yarn-project/end-to-end/src/e2e_l1_publisher/e2e_l1_publisher.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import {
5858
import { L1PublishedData } from '@aztec/stdlib/checkpoint';
5959
import { type L1RollupConstants, getSlotStartBuildTimestamp } from '@aztec/stdlib/epoch-helpers';
6060
import { GasFees, GasSettings } from '@aztec/stdlib/gas';
61+
import { tryStop } from '@aztec/stdlib/interfaces/server';
6162
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
6263
import { orderAttestations } from '@aztec/stdlib/p2p';
6364
import {
@@ -162,8 +163,9 @@ describe('L1Publisher integration', () => {
162163
}
163164
};
164165

166+
let port = 8545; // We increase the port for each test to avoid anvil conflicts
165167
const setup = async (deployL1ContractsArgs: Partial<DeployAztecL1ContractsArgs> = {}) => {
166-
({ rpcUrl, anvil } = await startAnvil());
168+
({ rpcUrl, anvil } = await startAnvil({ port: port++ }));
167169
config.l1RpcUrls = [rpcUrl];
168170

169171
deployerAccount = privateKeyToAccount(deployerPK);
@@ -299,8 +301,8 @@ describe('L1Publisher integration', () => {
299301
};
300302

301303
afterEach(async () => {
302-
await anvil.stop();
303-
await worldStateSynchronizer.stop();
304+
await tryStop(anvil);
305+
await tryStop(worldStateSynchronizer);
304306
});
305307

306308
const makeProcessedTx = (seed = 0x1): Promise<ProcessedTx> =>

0 commit comments

Comments
 (0)