Skip to content

Commit

Permalink
fixup: Cleanup log configuration for load and warp testing
Browse files Browse the repository at this point in the history
  • Loading branch information
marun committed Mar 26, 2024
1 parent 6ec90ba commit c507aa6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
12 changes: 2 additions & 10 deletions tests/load/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (

"github.com/ethereum/go-ethereum/log"

"github.com/ava-labs/avalanchego/config"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/tests/fixture/e2e"
"github.com/ava-labs/avalanchego/tests/fixture/tmpnet"
Expand Down Expand Up @@ -59,22 +58,15 @@ var _ = ginkgo.Describe("[Load Simulator]", ginkgo.Ordered, func() {
ginkgo.BeforeAll(func() {
genesisPath := filepath.Join(repoRootPath, "tests/load/genesis/genesis.json")

// The load tests are flaky at high levels of evm logging, so leave it at
// the default level instead of raising it to debug (as the warp testing does).
chainConfig := tmpnet.FlagsMap{}

nodes := utils.NewTmpnetNodes(nodeCount)

env = e2e.NewTestEnvironment(
flagVars,
utils.NewTmpnetNetwork(
"subnet-evm-small-load",
nodes,
tmpnet.FlagsMap{
// The default tmpnet log level (debug) induces too much overhead for load testing.
config.LogLevelKey: "info",
},
utils.NewTmpnetSubnet(subnetAName, genesisPath, chainConfig, nodes...),
tmpnet.FlagsMap{},
utils.NewTmpnetSubnet(subnetAName, genesisPath, utils.DefaultChainConfig, nodes...),
),
)
})
Expand Down
7 changes: 5 additions & 2 deletions tests/utils/tmpnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ import (
"github.com/ava-labs/subnet-evm/plugin/evm"
)

var DefaultChainConfig = tmpnet.FlagsMap{
"log-level": "debug",
"warp-api-enabled": true,
}

func NewTmpnetNodes(count int) []*tmpnet.Node {
nodes := make([]*tmpnet.Node, count)
for i := range nodes {
Expand All @@ -28,8 +33,6 @@ func NewTmpnetNetwork(owner string, nodes []*tmpnet.Node, flags tmpnet.FlagsMap,
defaultFlags := tmpnet.FlagsMap{}
defaultFlags.SetDefaults(flags)
defaultFlags.SetDefaults(tmpnet.FlagsMap{
// Remove when vendored tmpnet default is `off`. tmpnet nodes are run headless so stdout logging is unnecessary.
config.LogDisplayLevelKey: "off",
config.ProposerVMUseCurrentHeightKey: true,
})
return &tmpnet.Network{
Expand Down
9 changes: 2 additions & 7 deletions tests/warp/warp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ func TestE2E(t *testing.T) {
var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
// Run only once in the first ginkgo process

chainConfig := tmpnet.FlagsMap{
"log-level": "debug",
"warp-api-enabled": true,
}

nodes := utils.NewTmpnetNodes(tmpnet.DefaultNodeCount)

env := e2e.NewTestEnvironment(
Expand All @@ -107,8 +102,8 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
"subnet-evm-warp-e2e",
nodes,
tmpnet.FlagsMap{},
utils.NewTmpnetSubnet(subnetAName, genesisPath, chainConfig, nodes...),
utils.NewTmpnetSubnet(subnetBName, genesisPath, chainConfig, nodes...),
utils.NewTmpnetSubnet(subnetAName, genesisPath, utils.DefaultChainConfig, nodes...),
utils.NewTmpnetSubnet(subnetBName, genesisPath, utils.DefaultChainConfig, nodes...),
),
)

Expand Down

0 comments on commit c507aa6

Please sign in to comment.