From 8cdc34791d040f8ec5039518331a143ec0a71d0d Mon Sep 17 00:00:00 2001 From: Dmytro Haidashenko <34754799+dhaidashenko@users.noreply.github.com> Date: Tue, 12 Mar 2024 03:00:22 +0100 Subject: [PATCH] fixed evm client flake (#12376) * fixed evm client flake * change set * Revert "change set" This reverts commit 04e167b524c67d6a6ef64922eed1374c4468c19e. --------- Co-authored-by: Prashant Yadav <34992934+prashantkumar1982@users.noreply.github.com> --- core/chains/evm/client/chain_client_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/chains/evm/client/chain_client_test.go b/core/chains/evm/client/chain_client_test.go index 1718036641e..13fddf67622 100644 --- a/core/chains/evm/client/chain_client_test.go +++ b/core/chains/evm/client/chain_client_test.go @@ -23,8 +23,9 @@ func newMockRpc(t *testing.T) *mocks.RPCClient { mockRpc.On("Dial", mock.Anything).Return(nil).Once() mockRpc.On("Close").Return(nil).Once() mockRpc.On("ChainID", mock.Anything).Return(testutils.FixtureChainID, nil).Once() - mockRpc.On("Subscribe", mock.Anything, mock.Anything, mock.Anything).Return(client.NewMockSubscription(), nil).Once() - mockRpc.On("SetAliveLoopSub", mock.Anything).Return().Once() + // node does not always manage to fully setup aliveLoop, so we have to make calls optional to avoid flakes + mockRpc.On("Subscribe", mock.Anything, mock.Anything, mock.Anything).Return(client.NewMockSubscription(), nil).Maybe() + mockRpc.On("SetAliveLoopSub", mock.Anything).Return().Maybe() return mockRpc }