From 0da474ec4cb0cbb800d041c19b34edb27146be41 Mon Sep 17 00:00:00 2001 From: Hansie Odendaal Date: Thu, 28 Oct 2021 08:32:10 +0200 Subject: [PATCH] Fix merge conflicts, adjust time-outs --- integration_tests/README.md | 2 +- integration_tests/features/WalletFFI.feature | 4 +- .../features/support/ffi_steps.js | 60 +++++++++++-------- 3 files changed, 39 insertions(+), 27 deletions(-) diff --git a/integration_tests/README.md b/integration_tests/README.md index aa60fc9108..6a1bc7ba7e 100644 --- a/integration_tests/README.md +++ b/integration_tests/README.md @@ -59,7 +59,7 @@ # Runs a specific FFI test npm test -- --profile ci --name "My wallet FFI test scenario name" # Runs a complete set of FFI tests - npm test -- --profile ci --tags "@my-wallet-ffi-tag-name" + npm test -- --profile ci --tags "@wallet-ffi" ``` - Runs all @critical tests, but not @long-running diff --git a/integration_tests/features/WalletFFI.feature b/integration_tests/features/WalletFFI.feature index 7bf7472a95..6b5ee539d0 100644 --- a/integration_tests/features/WalletFFI.feature +++ b/integration_tests/features/WalletFFI.feature @@ -47,10 +47,10 @@ Feature: Wallet FFI Scenario: As a client I want to cancel a transaction Given I have a base node BASE And I have wallet SENDER connected to base node BASE + And I have a ffi wallet FFI_WALLET connected to base node BASE And I have mining node MINER connected to base node BASE and wallet SENDER And mining node MINER mines 10 blocks Then I wait for wallet SENDER to have at least 1000000 uT - And I have a ffi wallet FFI_WALLET connected to base node BASE And I send 2000000 uT without waiting for broadcast from wallet SENDER to wallet FFI_WALLET at fee 20 Then ffi wallet FFI_WALLET detects AT_LEAST 1 ffi transactions to be Broadcast And wallet SENDER detects all transactions are at least Broadcast @@ -103,10 +103,10 @@ Feature: Wallet FFI And I have a base node BASE1 connected to all seed nodes And I have a base node BASE2 connected to all seed nodes And I have wallet SENDER connected to base node BASE1 + And I have a ffi wallet FFI_WALLET connected to base node BASE1 And I have mining node MINER connected to base node BASE1 and wallet SENDER And mining node MINER mines 10 blocks Then I wait for wallet SENDER to have at least 1000000 uT - And I have a ffi wallet FFI_WALLET connected to base node BASE1 And I stop ffi wallet FFI_WALLET And I send 2000000 uT without waiting for broadcast from wallet SENDER to wallet FFI_WALLET at fee 20 And I restart ffi wallet FFI_WALLET connected to base node BASE2 diff --git a/integration_tests/features/support/ffi_steps.js b/integration_tests/features/support/ffi_steps.js index 4c63bfea1c..dbc2cddbc6 100644 --- a/integration_tests/features/support/ffi_steps.js +++ b/integration_tests/features/support/ffi_steps.js @@ -162,14 +162,14 @@ When( Then( "I wait for ffi wallet {word} to have {int} pending outbound transaction(s)", - { timeout: 40 * 1000 }, + { timeout: 125 * 1000 }, async function (walletName, count) { let wallet = this.getWallet(walletName); let broadcast = wallet.getOutboundTransactions(); let length = broadcast.getLength(); broadcast.destroy(); let retries = 1; - const retries_limit = 100; + const retries_limit = 120; while (length != count && retries <= retries_limit) { await sleep(1000); broadcast = wallet.getOutboundTransactions(); @@ -248,6 +248,7 @@ Then( Then( "I wait for ffi wallet {word} to receive {int} transaction", + { timeout: 125 * 1000 }, async function (walletName, amount) { let wallet = this.getWallet(walletName); @@ -262,7 +263,7 @@ Then( }, true, 1000, - 700 + 120 ); if (!(wallet.getCounters().received >= amount)) { @@ -276,7 +277,7 @@ Then( Then( "I wait for ffi wallet {word} to receive {int} finalization", - { timeout: 126 * 1000 }, + { timeout: 125 * 1000 }, async function (walletName, amount) { let wallet = this.getWallet(walletName); @@ -295,7 +296,7 @@ Then( }, true, 1000, - 700 + 120 ); if (!(wallet.getCounters().finalized >= amount)) { @@ -309,6 +310,7 @@ Then( Then( "I wait for ffi wallet {word} to receive {int} broadcast", + { timeout: 125 * 1000 }, async function (walletName, amount) { let wallet = this.getWallet(walletName); @@ -327,7 +329,7 @@ Then( }, true, 1000, - 700 + 120 ); if (!(wallet.getCounters().broadcast >= amount)) { @@ -341,7 +343,7 @@ Then( Then( "I wait for ffi wallet {word} to receive {int} mined", - { timeout: 7 * 1000 }, + { timeout: 125 * 1000 }, async function (walletName, amount) { let wallet = this.getWallet(walletName); @@ -360,7 +362,7 @@ Then( }, true, 1000, - 700 + 120 ); if (!(wallet.getCounters().mined >= amount)) { @@ -374,6 +376,7 @@ Then( Then( "I wait for ffi wallet {word} to receive {word} {int} SAF message", + { timeout: 125 * 1000 }, async function (walletName, comparison, amount) { const atLeast = "AT_LEAST"; const exactly = "EXACTLY"; @@ -395,7 +398,7 @@ Then( }, true, 1000, - 700 + 120 ); if (!(wallet.getCounters().saf >= amount)) { @@ -413,6 +416,7 @@ Then( Then( "I wait for ffi wallet {word} to have at least {int} uT", + { timeout: 125 * 1000 }, async function (walletName, amount) { let wallet = this.getWallet(walletName); @@ -427,7 +431,7 @@ Then( }, true, 1000, - 700 + 120 ); let balance = wallet.getBalance().available; @@ -442,7 +446,7 @@ Then( Then( "ffi wallet {word} detects {word} {int} ffi transactions to be Broadcast", - { timeout: 1200 * 1000 }, + { timeout: 125 * 1000 }, async function (walletName, comparison, amount) { // Pending -> Completed -> Broadcast -> Mined Unconfirmed -> Mined Confirmed const atLeast = "AT_LEAST"; @@ -467,7 +471,7 @@ Then( }, true, 1000, - 700 + 120 ); if (!(wallet.getCounters().broadcast >= amount)) { @@ -542,15 +546,19 @@ Then( } ); -When("I stop ffi wallet {word}", async function (walletName) { -When("I stop ffi wallet {word}", { timeout: 100 }, function (walletName) { - let wallet = this.getWallet(walletName); - await wallet.stop(); - wallet.resetCounters(); -}); +When( + "I stop ffi wallet {word}", + { timeout: 20 * 1000 }, + async function (walletName) { + let wallet = this.getWallet(walletName); + await wallet.stop(); + wallet.resetCounters(); + } +); Then( "I start TXO validation on ffi wallet {word}", + { timeout: 125 * 1000 }, async function (walletName) { const wallet = this.getWallet(walletName); await wallet.startTxoValidation(); @@ -560,10 +568,14 @@ Then( } ); -Then("I start TX validation on ffi wallet {word}", async function (walletName) { - const wallet = this.getWallet(walletName); - await wallet.startTxValidation(); - while (!wallet.getTxValidationStatus().tx_validation_complete) { - await sleep(1000); +Then( + "I start TX validation on ffi wallet {word}", + { timeout: 125 * 1000 }, + async function (walletName) { + const wallet = this.getWallet(walletName); + await wallet.startTxValidation(); + while (!wallet.getTxValidationStatus().tx_validation_complete) { + await sleep(1000); + } } -}); +);