From 86f5c59d3c92bf3a03ea5fed65acdbb1518eb2a6 Mon Sep 17 00:00:00 2001 From: Jayasudha Jayakumaran <121061531+jazz-cb@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:16:45 -0700 Subject: [PATCH] [chore] fix flaky e2e test (#103) ### What changed? Why? Change e2e test to 1. Move 1 gwei from imported address to new address 2. Fund new address with faucet 3. Move eth from new address to imported address The old flow is 1. Move 1 gwei from imported to new 2. Move eth from imported to new 3. Move gwei from new to imported This caused flaky errors because new address often didnt have enough gas #### Qualified Impact --- spec/e2e/end_to_end.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/spec/e2e/end_to_end.rb b/spec/e2e/end_to_end.rb index 21e444bd..d97fc819 100644 --- a/spec/e2e/end_to_end.rb +++ b/spec/e2e/end_to_end.rb @@ -103,20 +103,19 @@ def fetch_addresses_balances_test(wallet) def transfer_test(imported_address, new_address) # Transfer gwei from imported address to new address. - puts 'Transfering 1 Gwei from imported address to new address...' + puts 'Transferring 1 Gwei from imported address to new address...' t = imported_address.transfer(1, :gwei, new_address).wait! expect(t.status).to eq('complete') puts "Transferred 1 Gwei from #{imported_address} to #{new_address}" - # Transfer some eth for gas fee to new address. - t2 = imported_address.transfer(0.00001, :eth, new_address).wait! - expect(t2.status).to eq('complete') - puts "Transferred 0.00001 Eth from #{imported_address} to #{new_address}" + # Fund the new address with faucet. + faucet_tx = new_address.faucet + puts "Requested faucet funds: #{faucet_tx}" - # Transfer gwei back from new address to imported address. - t = new_address.transfer(1, :gwei, imported_address).wait! + # Transfer eth back from new address to imported address. + t = new_address.transfer(0.008, :eth, imported_address).wait! expect(t.status).to eq('complete') - puts "Transferred 1 Gwei from #{new_address} to #{imported_address}" + puts "Transferred 0.008 eth from #{new_address} to #{imported_address}" puts 'Fetching updated balances...' first_balance = imported_address.balances