From 50a50b7a57432118162a5e2374282116b5e2c53e Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Wed, 8 Jan 2025 10:32:55 +0100 Subject: [PATCH] Use DeterministicEthScheduler in unit tests Signed-off-by: Ameziane H. --- .../jsonrpc/internal/methods/DebugTraceBlockByNumber.java | 2 +- .../api/jsonrpc/AbstractJsonRpcHttpServiceTest.java | 4 ++-- .../api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java | 4 ++-- .../ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java | 4 ++-- .../api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java | 6 +++--- .../ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java | 4 ++-- .../api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java | 4 ++-- .../jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java | 4 ++-- .../ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java | 4 ++-- .../internal/methods/DebugTraceBlockByHashTest.java | 7 ++----- .../internal/methods/DebugTraceBlockByNumberTest.java | 7 ++----- .../api/jsonrpc/internal/methods/DebugTraceBlockTest.java | 4 ++-- .../api/jsonrpc/internal/methods/TraceFilterTest.java | 4 ++-- .../api/jsonrpc/websocket/WebSocketServiceLoginTest.java | 3 ++- 14 files changed, 28 insertions(+), 33 deletions(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java index 2ccde9cfdb1..25a1a25a024 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java @@ -153,6 +153,6 @@ protected Object resultByBlockNumber( } return Optional.of(tracesList); })) - .orElse(null); + .orElse(Collections.emptyList()); } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java index 900744f1a27..a51483ce1e3 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java @@ -42,7 +42,6 @@ import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.ValidationResult; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -54,6 +53,7 @@ import org.hyperledger.besu.nat.NatService; import org.hyperledger.besu.plugin.services.storage.DataStorageFormat; import org.hyperledger.besu.testutil.BlockTestUtil.ChainResources; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.net.URL; @@ -216,7 +216,7 @@ protected Map getRpcMethods( mock(ApiConfiguration.class), Optional.empty(), transactionSimulator, - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); } protected void startService() throws Exception { diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java index 7afc43f259c..466269ab169 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java @@ -35,7 +35,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -46,6 +45,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.io.IOException; import java.math.BigInteger; @@ -142,7 +142,7 @@ public void initServerAndClient() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); service = createJsonRpcHttpService(); service.start().join(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java index fdae2d34cab..1d8189f3d15 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java @@ -42,7 +42,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -51,6 +50,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.io.IOException; import java.math.BigInteger; @@ -173,7 +173,7 @@ public static void initServerAndClient() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); service = createJsonRpcHttpService(); jwtAuth = service.authenticationService.get().getJwtAuthProvider(); service.start().join(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java index f90233fe015..2653f206496 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java @@ -42,7 +42,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration; import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration; @@ -56,6 +55,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.nio.file.Path; @@ -239,7 +239,7 @@ private JsonRpcHttpService createJsonRpcHttpServiceWithRpcApis(final JsonRpcConf mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); final JsonRpcHttpService jsonRpcHttpService = new JsonRpcHttpService( vertx, @@ -352,7 +352,7 @@ private JsonRpcHttpService createJsonRpcHttpService( mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); final JsonRpcHttpService jsonRpcHttpService = new JsonRpcHttpService( vertx, diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java index aabd447c476..b9d4a8adc11 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java @@ -35,7 +35,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -47,6 +46,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.nio.file.Path; @@ -151,7 +151,7 @@ public static void initServerAndClient() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); disabledRpcMethods = new HashMap<>(); addedRpcMethods = new HashSet<>(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java index 24cffa66b9a..36682145bd8 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java @@ -42,7 +42,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -53,6 +52,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.io.FileOutputStream; import java.io.IOException; @@ -158,7 +158,7 @@ public void initServer() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); System.setProperty("javax.net.ssl.trustStore", CLIENT_AS_CA_CERT.getKeyStoreFile().toString()); System.setProperty( diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java index 6f51e6cb6fc..a8664638a2d 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java @@ -41,7 +41,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -52,6 +51,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.io.IOException; import java.math.BigInteger; @@ -144,7 +144,7 @@ public void beforeEach() { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); } @AfterEach diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java index 3fc450934fb..95fba300709 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java @@ -41,7 +41,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -52,6 +51,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.io.IOException; import java.io.UncheckedIOException; @@ -145,7 +145,7 @@ public void initServer() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); service = createJsonRpcHttpService(createJsonRpcConfig()); service.start().join(); baseUrl = service.url(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHashTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHashTest.java index c240c8bd604..6c17661f6a5 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHashTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHashTest.java @@ -33,9 +33,9 @@ import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.Block; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.metrics.ObservableMetricsSystem; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.util.Arrays; import java.util.Collection; @@ -68,10 +68,7 @@ public class DebugTraceBlockByHashTest { public void setUp() { debugTraceBlockByHash = new DebugTraceBlockByHash( - protocolSchedule, - blockchainQueries, - metricsSystem, - new EthScheduler(1, 1, 1, metricsSystem)); + protocolSchedule, blockchainQueries, metricsSystem, new DeterministicEthScheduler()); } @Test diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumberTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumberTest.java index 986bd926971..3f2e39b5423 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumberTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumberTest.java @@ -33,9 +33,9 @@ import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.BlockHeader; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.metrics.ObservableMetricsSystem; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.util.Arrays; import java.util.Collection; @@ -68,10 +68,7 @@ public class DebugTraceBlockByNumberTest { public void setUp() { debugTraceBlockByNumber = new DebugTraceBlockByNumber( - protocolSchedule, - blockchainQueries, - metricsSystem, - new EthScheduler(1, 1, 1, metricsSystem)); + protocolSchedule, blockchainQueries, metricsSystem, new DeterministicEthScheduler()); } @Test diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockTest.java index f040c2da323..04405b50fdc 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockTest.java @@ -38,7 +38,6 @@ import org.hyperledger.besu.ethereum.core.ExecutionContextTestFixture; import org.hyperledger.besu.ethereum.core.MiningConfiguration; import org.hyperledger.besu.ethereum.core.PrivacyParameters; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.MainnetBlockHeaderFunctions; import org.hyperledger.besu.ethereum.mainnet.ProtocolScheduleBuilder; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpecAdapters; @@ -47,6 +46,7 @@ import org.hyperledger.besu.evm.internal.EvmConfiguration; import org.hyperledger.besu.metrics.ObservableMetricsSystem; import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.util.Arrays; @@ -113,7 +113,7 @@ public void setUp() { executionContextTestFixture.getProtocolSchedule(), blockchainQueries, metricsSystem, - new EthScheduler(1, 1, 1, metricsSystem)); + new DeterministicEthScheduler()); } @Test diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java index 08a8ac30780..9f0104a30e3 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java @@ -25,9 +25,9 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.util.function.Supplier; @@ -76,7 +76,7 @@ public void shouldFailIfParamsExceedMaxRange( blockchainQueries, maxFilterRange, new NoOpMetricsSystem(), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); final JsonRpcResponse response = method.response(request); assertThat(response).isInstanceOf(JsonRpcErrorResponse.class); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java index 7b39d37887c..fa9748432cf 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java @@ -58,6 +58,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.net.URISyntaxException; @@ -208,7 +209,7 @@ public void before() throws URISyntaxException { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem()))); + new DeterministicEthScheduler())); websocketMethods.putAll(rpcMethods); webSocketMessageHandlerSpy =