Skip to content

Commit

Permalink
Fix flakiness ofTxPoolOptionsTest::txpoolForcePriceBumpToZeroWhenZero…
Browse files Browse the repository at this point in the history
…BaseFeeMarket

Signed-off-by: Fabio Di Fabio <[email protected]>
  • Loading branch information
fab-10 committed Sep 13, 2024
1 parent 6ea0ed4 commit 8717b5d
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
Expand Down Expand Up @@ -256,10 +255,7 @@ public abstract class CommandTestAbstract {

@BeforeEach
public void initMocks() throws Exception {
// doReturn used because of generic BesuController
doReturn(mockControllerBuilder)
.when(mockControllerBuilderFactory)
.fromEthNetworkConfig(any(), any());
when(mockControllerBuilderFactory.fromEthNetworkConfig(any(), any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.synchronizerConfiguration(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.ethProtocolConfiguration(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.transactionPoolConfiguration(any()))
Expand Down Expand Up @@ -288,14 +284,13 @@ public void initMocks() throws Exception {
when(mockControllerBuilder.maxPeers(anyInt())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.maxRemotelyInitiatedPeers(anyInt()))
.thenReturn(mockControllerBuilder);
when(mockControllerBuilder.besuComponent(any(BesuComponent.class)))
when(mockControllerBuilder.besuComponent(any()))
.thenReturn(mockControllerBuilder);
when(mockControllerBuilder.cacheLastBlocks(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.genesisStateHashCacheEnabled(any()))
.thenReturn(mockControllerBuilder);

// doReturn used because of generic BesuController
doReturn(mockController).when(mockControllerBuilder).build();
when(mockControllerBuilder.build()).thenReturn(mockController);
lenient().when(mockController.getProtocolManager()).thenReturn(mockEthProtocolManager);
lenient().when(mockController.getProtocolSchedule()).thenReturn(mockProtocolSchedule);
lenient().when(mockController.getProtocolContext()).thenReturn(mockProtocolContext);
Expand Down

0 comments on commit 8717b5d

Please sign in to comment.