Commit 54305b4e authored by Hamdi Allam's avatar Hamdi Allam Committed by GitHub

fix flakiness (#8774)

parent 0fcbe0b2
......@@ -13,6 +13,7 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum-optimism/optimism/op-node/withdrawals"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/params"
"github.com/stretchr/testify/require"
......@@ -114,7 +115,12 @@ func TestE2EBridgeL2CrossDomainMessenger(t *testing.T) {
l1Opts.Value = l2Opts.Value
depositTx, err := optimismPortal.Receive(l1Opts)
require.NoError(t, err)
_, err = wait.ForReceiptOK(context.Background(), testSuite.L1Client, depositTx.Hash())
depositReceipt, err := wait.ForReceiptOK(context.Background(), testSuite.L1Client, depositTx.Hash())
require.NoError(t, err)
depositInfo, err := e2etest_utils.ParseDepositInfo(depositReceipt)
require.NoError(t, err)
depositL2TxHash := types.NewTx(depositInfo.DepositTx).Hash()
_, err = wait.ForReceiptOK(context.Background(), testSuite.L2Client, depositL2TxHash)
require.NoError(t, err)
// (1) Send the Message
......
......@@ -94,7 +94,12 @@ func TestE2EBridgeTransactionsL2ToL1MessagePasserWithdrawal(t *testing.T) {
l1Opts.Value = l2Opts.Value
depositTx, err := optimismPortal.Receive(l1Opts)
require.NoError(t, err)
_, err = wait.ForReceiptOK(context.Background(), testSuite.L1Client, depositTx.Hash())
depositReceipt, err := wait.ForReceiptOK(context.Background(), testSuite.L1Client, depositTx.Hash())
require.NoError(t, err)
depositInfo, err := e2etest_utils.ParseDepositInfo(depositReceipt)
require.NoError(t, err)
depositL2TxHash := types.NewTx(depositInfo.DepositTx).Hash()
_, err = wait.ForReceiptOK(context.Background(), testSuite.L2Client, depositL2TxHash)
require.NoError(t, err)
withdrawTx, err := l2ToL1MessagePasser.InitiateWithdrawal(l2Opts, aliceAddr, big.NewInt(100_000), calldata)
......
......@@ -240,7 +240,12 @@ func TestE2EBridgeTransfersStandardBridgeETHWithdrawal(t *testing.T) {
l1Opts.Value = l2Opts.Value
depositTx, err := optimismPortal.Receive(l1Opts)
require.NoError(t, err)
_, err = wait.ForReceiptOK(context.Background(), testSuite.L1Client, depositTx.Hash())
depositReceipt, err := wait.ForReceiptOK(context.Background(), testSuite.L1Client, depositTx.Hash())
require.NoError(t, err)
depositInfo, err := e2etest_utils.ParseDepositInfo(depositReceipt)
require.NoError(t, err)
depositL2TxHash := types.NewTx(depositInfo.DepositTx).Hash()
_, err = wait.ForReceiptOK(context.Background(), testSuite.L2Client, depositL2TxHash)
require.NoError(t, err)
// (1) Test Withdrawal Initiation
......@@ -324,7 +329,12 @@ func TestE2EBridgeTransfersL2ToL1MessagePasserETHReceive(t *testing.T) {
l1Opts.Value = l2Opts.Value
depositTx, err := optimismPortal.Receive(l1Opts)
require.NoError(t, err)
_, err = wait.ForReceiptOK(context.Background(), testSuite.L1Client, depositTx.Hash())
depositReceipt, err := wait.ForReceiptOK(context.Background(), testSuite.L1Client, depositTx.Hash())
require.NoError(t, err)
depositInfo, err := e2etest_utils.ParseDepositInfo(depositReceipt)
require.NoError(t, err)
depositL2TxHash := types.NewTx(depositInfo.DepositTx).Hash()
_, err = wait.ForReceiptOK(context.Background(), testSuite.L2Client, depositL2TxHash)
require.NoError(t, err)
// (1) Test Withdrawal Initiation
......@@ -511,6 +521,11 @@ func TestClientBridgeFunctions(t *testing.T) {
require.NoError(t, err)
depositReceipt, err := wait.ForReceiptOK(context.Background(), testSuite.L1Client, depositTx.Hash())
require.NoError(t, err)
depositInfo, err := e2etest_utils.ParseDepositInfo(depositReceipt)
require.NoError(t, err)
depositL2TxHash := types.NewTx(depositInfo.DepositTx).Hash()
_, err = wait.ForReceiptOK(context.Background(), testSuite.L2Client, depositL2TxHash)
require.NoError(t, err)
mintSum = new(big.Int).Add(mintSum, depositTx.Value())
......
......@@ -53,6 +53,9 @@ type E2ETestSuite struct {
}
func init() {
// Disable the global logger. Ideally we'd like to dump geth
// logs per-test but that's possible when running tests in
// parallel as the root logger is shared.
log.Root().SetHandler(log.DiscardHandler())
}
......@@ -69,8 +72,6 @@ func createE2ETestSuite(t *testing.T) E2ETestSuite {
// Bump up the block times to try minimize resource
// contention when parallel devnets are running
opCfg := op_e2e.DefaultSystemConfig(t)
opCfg.DeployConfig.L1BlockTime = 6
opCfg.DeployConfig.L2BlockTime = 2
// Unless specified, omit logs emitted by the various components
if len(os.Getenv("ENABLE_ROLLUP_LOGS")) == 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment