From 9834285c1424dab90d66f07875522666007bd6cb Mon Sep 17 00:00:00 2001 From: anirudhwarrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Thu, 14 Mar 2024 12:51:15 +0400 Subject: [PATCH 1/2] remove chainid references in benchmark test --- integration-tests/benchmark/keeper_test.go | 47 +++++++++++----------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/integration-tests/benchmark/keeper_test.go b/integration-tests/benchmark/keeper_test.go index d6c4c6b2587..e6cda6d7f27 100644 --- a/integration-tests/benchmark/keeper_test.go +++ b/integration-tests/benchmark/keeper_test.go @@ -141,7 +141,7 @@ func TestAutomationBenchmark(t *testing.T) { networkName := strings.ReplaceAll(benchmarkNetwork.Name, " ", "") testName := fmt.Sprintf("%s%s", networkName, *config.Keeper.Common.RegistryToTest) l.Info().Str("Test Name", testName).Msg("Running Benchmark Test") - benchmarkTestNetwork := getNetworkConfig(networkName, &config) + benchmarkTestNetwork := getNetworkConfig(&config) l.Info().Str("Namespace", testEnvironment.Cfg.Namespace).Msg("Connected to Keepers Benchmark Environment") @@ -239,14 +239,15 @@ func repeatRegistries(registryVersion eth_contracts.KeeperRegistryVersion, numbe return repeatedRegistries } -func getNetworkConfig(networkName string, config *tc.TestConfig) NetworkConfig { +func getNetworkConfig(config *tc.TestConfig) NetworkConfig { + evmNetwork := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0] var nc NetworkConfig var ok bool - if nc, ok = networkConfig[networkName]; !ok { + if nc, ok = networkConfig[evmNetwork.Name]; !ok { return defaultNetworkConfig } - if networkName == "SimulatedGeth" || networkName == "geth" { + if evmNetwork.Name == networks.SimulatedEVM.Name || evmNetwork.Name == networks.SimulatedEVMNonDev.Name { return nc } @@ -256,63 +257,63 @@ func getNetworkConfig(networkName string, config *tc.TestConfig) NetworkConfig { } var networkConfig = map[string]NetworkConfig{ - "SimulatedGeth": { + networks.SimulatedEVM.Name: { upkeepSLA: int64(120), //2 minutes blockTime: time.Second, deltaStage: 30 * time.Second, funding: big.NewFloat(100_000), }, - "geth": { + networks.SimulatedEVMNonDev.Name: { upkeepSLA: int64(120), //2 minutes blockTime: time.Second, deltaStage: 30 * time.Second, funding: big.NewFloat(100_000), }, - "GoerliTestnet": { + networks.GoerliTestnet.Name: { upkeepSLA: int64(4), blockTime: 12 * time.Second, deltaStage: time.Duration(0), }, - "ArbitrumGoerli": { - upkeepSLA: int64(20), - blockTime: time.Second, - deltaStage: time.Duration(0), - }, - "OptimismGoerli": { - upkeepSLA: int64(20), - blockTime: time.Second, - deltaStage: time.Duration(0), - }, - "SepoliaTestnet": { + networks.SepoliaTestnet.Name: { upkeepSLA: int64(4), blockTime: 12 * time.Second, deltaStage: time.Duration(0), }, - "PolygonMumbai": { + networks.PolygonMumbai.Name: { upkeepSLA: int64(4), blockTime: 12 * time.Second, deltaStage: time.Duration(0), }, - "BaseGoerli": { + networks.BaseGoerli.Name: { upkeepSLA: int64(60), blockTime: 2 * time.Second, deltaStage: 20 * time.Second, }, - "ArbitrumSepolia": { + networks.ArbitrumSepolia.Name: { + upkeepSLA: int64(120), + blockTime: time.Second, + deltaStage: 20 * time.Second, + }, + networks.OptimismSepolia.Name: { upkeepSLA: int64(120), blockTime: time.Second, deltaStage: 20 * time.Second, }, - "LineaGoerli": { + networks.LineaGoerli.Name: { upkeepSLA: int64(120), blockTime: time.Second, deltaStage: 20 * time.Second, }, - "GnosisChiado": { + networks.GnosisChiado.Name: { upkeepSLA: int64(120), blockTime: 6 * time.Second, deltaStage: 20 * time.Second, }, + networks.PolygonZkEvmCardona.Name: { + upkeepSLA: int64(120), + blockTime: time.Second, + deltaStage: 20 * time.Second, + }, } func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.KeeperBenchmarkTestConfig) (*environment.Environment, blockchain.EVMNetwork) { From 7ac2fb733e29bbeff8e4db94cbb51d296c793b5d Mon Sep 17 00:00:00 2001 From: anirudhwarrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Thu, 14 Mar 2024 12:53:21 +0400 Subject: [PATCH 2/2] fix TTL issue in load test --- .../load/automationv2_1/automationv2_1_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/integration-tests/load/automationv2_1/automationv2_1_test.go b/integration-tests/load/automationv2_1/automationv2_1_test.go index bfd39ad4d54..0b902423339 100644 --- a/integration-tests/load/automationv2_1/automationv2_1_test.go +++ b/integration-tests/load/automationv2_1/automationv2_1_test.go @@ -181,7 +181,7 @@ Load Config: } testEnvironment := environment.New(&environment.Config{ - TTL: loadDuration + time.Hour*6, + TTL: loadDuration.Round(time.Hour) + time.Hour, NamespacePrefix: fmt.Sprintf( "automation-%s-%s", testType, @@ -712,6 +712,16 @@ Test Duration: %s` t.Cleanup(func() { if err = actions.TeardownRemoteSuite(t, testEnvironment.Cfg.Namespace, chainlinkNodes, nil, &loadedTestConfig, chainClient); err != nil { l.Error().Err(err).Msg("Error when tearing down remote suite") + testEnvironment.Cfg.TTL = time.Hour * 48 + err := testEnvironment.Run() + if err != nil { + l.Error().Err(err).Msg("Error increasing TTL of namespace") + } + } else if chainClient.NetworkSimulated() { + err := testEnvironment.Client.RemoveNamespace(testEnvironment.Cfg.Namespace) + if err != nil { + l.Error().Err(err).Msg("Error removing namespace") + } } })