Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: finality gadget itest fix comments #35

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion itest/opstackl2/op_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ func TestFinalityGadgetServer(t *testing.T) {
return false
}
require.NoError(t, err)
return block.BlockHeight > targetBlockHeight+6
// check N blocks are processed as finalized
// we pick a small N = 5 here to minimize the test time
return block.BlockHeight > targetBlockHeight+5
}, 40*time.Second, 5*time.Second, "Failed to process blocks")

// stop the finality gadget
Expand Down
12 changes: 1 addition & 11 deletions itest/opstackl2/op_test_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
defaultlog "log"
"os"
"path/filepath"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -69,8 +67,6 @@ type OpL2ConsumerTestManager struct {
}

func StartOpL2ConsumerManager(t *testing.T, numOfConsumerFPs uint8) *OpL2ConsumerTestManager {
defaultlog.SetOutput(os.Stdout)

// Setup base dir and logger
testDir, err := e2eutils.BaseDir("fpe2etest")
require.NoError(t, err)
Expand Down Expand Up @@ -129,7 +125,7 @@ func StartOpL2ConsumerManager(t *testing.T, numOfConsumerFPs uint8) *OpL2Consume
L2RPCHost: opL2ConsumerConfig.OPStackL2RPCAddress,
BitcoinRPCHost: "rpc.ankr.com/btc",
FGContractAddress: opL2ConsumerConfig.OPFinalityGadgetAddress,
BBNChainID: "chain-test",
BBNChainID: e2eutils.ChainID,
BBNRPCAddress: opL2ConsumerConfig.RPCAddr,
DBFilePath: "data.db",
GRPCServerPort: babylonFinalityGadgetRpcPort,
Expand Down Expand Up @@ -527,11 +523,6 @@ func mockOpL2ConsumerCtrlConfig(nodeDataDir string) *fpcfg.OPStackL2Config {
}
}

func trimLeadingHttp(s string) string {
t := strings.TrimPrefix(s, "http://")
return strings.TrimPrefix(t, "https://")
}

func (ctm *OpL2ConsumerTestManager) WaitForServicesStart(t *testing.T) {
require.Eventually(t, func() bool {
params, err := ctm.BBNClient.QueryStakingParams()
Expand Down Expand Up @@ -841,7 +832,6 @@ func (ctm *OpL2ConsumerTestManager) WaitForBlockFinalized(
t.Logf(log.Prefix("failed to query latest finalized block %s"), err.Error())
return false
}
require.NoError(t, err)
finalizedBlockHeight = latestFinalizedBlock.Height
return finalizedBlockHeight >= checkedHeight
}, e2eutils.EventuallyWaitTimeOut, 5*ctm.getL2BlockTime())
Expand Down
Loading