From 5d4cdc11977ea2af5e465092ce9e635414c13710 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Wed, 11 Dec 2024 09:21:24 -0300 Subject: [PATCH] chore: Handle errors in e2e teardown to fix e2e token (#10590) `e2e-token` test was failing due to a telemetry shutdown from one of the test suites affecting another. Try/catching the environment teardown seems to patch the issue. --- .../src/fixtures/snapshot_manager.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts b/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts index c2ac8ce04c5..7a0507a6e63 100644 --- a/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts +++ b/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts @@ -36,7 +36,7 @@ import { MNEMONIC } from './fixtures.js'; import { getACVMConfig } from './get_acvm_config.js'; import { getBBConfig } from './get_bb_config.js'; import { setupL1Contracts } from './setup_l1_contracts.js'; -import { type SetupOptions, createAndSyncProverNode, getPrivateKeyFromIndex } from './utils.js'; +import { type SetupOptions, createAndSyncProverNode, getLogger, getPrivateKeyFromIndex } from './utils.js'; import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js'; export type SubsystemsContext = { @@ -243,13 +243,18 @@ async function teardown(context: SubsystemsContext | undefined) { if (!context) { return; } - await context.proverNode?.stop(); - await context.aztecNode.stop(); - await context.pxe.stop(); - await context.acvmConfig?.cleanup(); - await context.anvil.stop(); - await context.watcher.stop(); - context.timer?.uninstall(); + try { + getLogger().info('Tearing down subsystems'); + await context.proverNode?.stop(); + await context.aztecNode.stop(); + await context.pxe.stop(); + await context.acvmConfig?.cleanup(); + await context.anvil.stop(); + await context.watcher.stop(); + context.timer?.uninstall(); + } catch (err) { + getLogger().error('Error during teardown', err); + } } /**