From 9cbd5d1478583693fb7015f25ac9af4d25ca6647 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Thu, 11 Apr 2024 14:33:06 +0200 Subject: [PATCH] Fix test flakyness Signed-off-by: Fabio Di Fabio --- .../java/linea/plugin/acc/test/LineaPluginTestBase.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/acceptance-tests/src/test/java/linea/plugin/acc/test/LineaPluginTestBase.java b/acceptance-tests/src/test/java/linea/plugin/acc/test/LineaPluginTestBase.java index 4275b8b6..38a898f1 100644 --- a/acceptance-tests/src/test/java/linea/plugin/acc/test/LineaPluginTestBase.java +++ b/acceptance-tests/src/test/java/linea/plugin/acc/test/LineaPluginTestBase.java @@ -150,7 +150,8 @@ private void assertTransactionsInCorrectBlocks(Web3j web3j, List hashes, protected SimpleStorage deploySimpleStorage() throws Exception { final Web3j web3j = minerNode.nodeRequests().eth(); final Credentials credentials = Credentials.create(Accounts.GENESIS_ACCOUNT_ONE_PRIVATE_KEY); - TransactionManager txManager = new RawTransactionManager(web3j, credentials, CHAIN_ID); + TransactionManager txManager = + new RawTransactionManager(web3j, credentials, CHAIN_ID, createReceiptProcessor(web3j)); final RemoteCall deploy = SimpleStorage.deploy(web3j, txManager, new DefaultGasProvider()); @@ -206,8 +207,8 @@ protected List> getTxPoolContent() { private TransactionReceiptProcessor createReceiptProcessor(Web3j web3j) { return new PollingTransactionReceiptProcessor( web3j, - TransactionManager.DEFAULT_POLLING_FREQUENCY, - TransactionManager.DEFAULT_POLLING_ATTEMPTS_PER_TX_HASH); + Math.max(1000, LINEA_CLIQUE_OPTIONS.blockPeriodSeconds() * 1000 / 5), + LINEA_CLIQUE_OPTIONS.blockPeriodSeconds() * 3); } protected String sendTransactionWithGivenLengthPayload(