From 13a094f3a706a797c90e93faf257bd8e01842b57 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Mon, 3 Feb 2025 15:06:43 -0300 Subject: [PATCH] Fix a leaky test that didn't work depending on the order of execution of tests --- test/unit/beacon_api/beacon_api_v1_test.exs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/unit/beacon_api/beacon_api_v1_test.exs b/test/unit/beacon_api/beacon_api_v1_test.exs index 2f4740647..f5d63f7b6 100644 --- a/test/unit/beacon_api/beacon_api_v1_test.exs +++ b/test/unit/beacon_api/beacon_api_v1_test.exs @@ -194,7 +194,12 @@ defmodule Unit.BeaconApiTest.V1 do patch(BeaconApi.EventPubSub, :publish, fn _, _ -> :ok end) patch(ForkChoice, :get_fork_version, fn -> ChainSpec.get("DENEB_FORK_VERSION") end) - start_link_supervised!({Libp2pPort, genesis_time: :os.system_time(:second), store: %Store{}}) + genesis_time = :os.system_time(:second) + + start_link_supervised!( + {Libp2pPort, genesis_time: genesis_time, store: %Store{genesis_time: genesis_time}} + ) + Metadata.init() identity = Libp2pPort.get_node_identity() metadata = Metadata.get_metadata()