Skip to content

Commit

Permalink
Adding additional load runner to verify reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
b-gopalswami committed Jul 17, 2024
1 parent 92c9d83 commit 2aab5b1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
34 changes: 17 additions & 17 deletions integration-tests/ccip-tests/chaos/reorg_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,23 @@ func (r *ReorgSuite) RunReorgBelowFinalityThreshold(startDelay time.Duration) {
require.NoError(r.t, err)
time.Sleep(r.Cfg.ExperimentDuration)

blocksBackDst := int(r.Cfg.DstFinalityDepth) - r.Cfg.FinalityDelta
r.Logger.Info().
Str("URL", r.SrcClient.URL).
Str("Case", "below finality").
Int("BlocksBack", blocksBackDst).
Msg("Rewinding blocks on dst chain")
err = r.DstClient.GethSetHead(blocksBackDst)
assert.NoError(r.t, err)
err = PostGrafanaAnnotation(
r.Logger,
r.GrafanaClient,
r.Cfg.dashboardUID,
fmt.Sprintf("rewinded dest chain for %d blocks back, finality is: %d", blocksBackDst, r.Cfg.DstFinalityDepth),
nil,
)
require.NoError(r.t, err)
time.Sleep(r.Cfg.ExperimentDuration)
//blocksBackDst := int(r.Cfg.DstFinalityDepth) - r.Cfg.FinalityDelta
//r.Logger.Info().
// Str("URL", r.SrcClient.URL).
// Str("Case", "below finality").
// Int("BlocksBack", blocksBackDst).
// Msg("Rewinding blocks on dst chain")
//err = r.DstClient.GethSetHead(blocksBackDst)
//assert.NoError(r.t, err)
//err = PostGrafanaAnnotation(
// r.Logger,
// r.GrafanaClient,
// r.Cfg.dashboardUID,
// fmt.Sprintf("rewinded dest chain for %d blocks back, finality is: %d", blocksBackDst, r.Cfg.DstFinalityDepth),
// nil,
//)
//require.NoError(r.t, err)
//time.Sleep(r.Cfg.ExperimentDuration)
}()
}

Expand Down
1 change: 1 addition & 0 deletions integration-tests/ccip-tests/load/ccip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func TestLoadCCIPStableRPSReorgsBelowFinality(t *testing.T) {
})
rs := setupReorgSuite(t, testArgs)
testArgs.TriggerLoadByLane()
testArgs.WaitForLoadStart()
rs.RunReorgBelowFinalityThreshold(1 * time.Minute)
testArgs.TriggerLoadByLane()
testArgs.Wait()
Expand Down
12 changes: 10 additions & 2 deletions integration-tests/ccip-tests/load/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,25 @@ func (l *LoadArgs) AddToRunnerGroup(gen *wasp.Generator) {
})
}

func (l *LoadArgs) Wait() {
func (l *LoadArgs) WaitForLoadStart() {
l.lggr.Info().Msg("Waiting for load to start on all lanes")
// wait for load runner to start
l.LoadStarterWg.Wait()
l.lggr.Info().Msg("Waiting for load to finish on all lanes")
l.lggr.Info().Msg("Load started on all lanes")
}

func (l *LoadArgs) WaitForLoadToFinish() {
// wait for load runner to finish
err := l.RunnerWg.Wait()
require.NoError(l.t, err, "load run is failed")
l.lggr.Info().Msg("Load finished on all lanes")
}

func (l *LoadArgs) Wait() {
l.WaitForLoadStart()
l.WaitForLoadToFinish()
}

func (l *LoadArgs) ApplyChaos() {
testEnv := l.TestSetupArgs.Env
if testEnv == nil || testEnv.K8Env == nil {
Expand Down
7 changes: 2 additions & 5 deletions integration-tests/ccip-tests/testconfig/tomls/ccip-reorg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,8 @@ PriceMax = '200 gwei'
LimitDefault = 6000000
FeeCapDefault = '200 gwei'
"""

[CCIP.Groups.load.LoadProfile]
TestDuration = '3m'


[CCIP.Groups.load]
BiDirectionalLane = true
[CCIP.Groups.load.LoadProfile]
RequestPerUnitTime = [1] # number of ccip requests to be sent per unit time
TimeUnit = '10s' # unit of time for RequestPerUnitTime
Expand Down

0 comments on commit 2aab5b1

Please sign in to comment.