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

Throttle integration test fixes #696

Merged
merged 2 commits into from
Feb 1, 2023
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 tests/integration/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ func (tr TestRun) waitForSlashThrottleDequeue(
}

if globalQueueSize == chainQueueSize && globalQueueSize == action.nextQueueSize {
return
break
}

if time.Now().After(timeout) {
Expand All @@ -1236,6 +1236,8 @@ func (tr TestRun) waitForSlashThrottleDequeue(

time.Sleep(500 * time.Millisecond)
}
// Sleep 20 seconds to pass a block, allowing the jailing to be incorporated into voting power
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MSalopek depending on block time when running in the cloud, this may need to be adjusted

time.Sleep(20 * time.Second)
}

func uintPointer(i uint) *uint {
Expand Down
8 changes: 5 additions & 3 deletions tests/integration/steps_downtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,17 @@ func stepsThrottledDowntime(consumerName string) []Step {
chain: chainID(consumerName),
currentQueueSize: 1,
nextQueueSize: 0,
timeout: time.Minute, // panic after reaching timeout
// Slash meter replenish fraction is set to 10%, replenish period is 20 seconds, see config.go
// Meter is initially at 10%, decremented to -23% from bob being jailed. It'll then take three replenishments
// for meter to become positive again. 3*20 = 60 seconds + buffer = 80 seconds
timeout: 80 * time.Second,
},
state: State{
// no changes in state should occur
chainID("provi"): ChainState{
ValPowers: &map[validatorID]uint{
validatorID("alice"): 511,
validatorID("bob"): 0,
validatorID("carol"): 500,
validatorID("carol"): 0, // Carol is jailed upon packet being handled on provider
},
GlobalSlashQueueSize: uintPointer(0), // slash packets dequeued
ConsumerChainQueueSizes: &map[chainID]uint{
Expand Down