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

Conversation

shaspitz
Copy link
Contributor

@shaspitz shaspitz commented Feb 1, 2023

Description

The diffs in #687 caused integration tests to fail, which is actually good and proves that the patch changed behavior. This PR fixes integration tests to be a bit more granular with the throttle behavior that's expected.

Type of change

  • Testing: Adds testing

New Behavior Testing

Full integration tests pass locally for me, make test-integration

@@ -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

@shaspitz shaspitz marked this pull request as ready for review February 1, 2023 18:29
Copy link
Contributor

@MSalopek MSalopek left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks for taking the time to look into this.

Copy link
Contributor

@jtremback jtremback left a comment

Choose a reason for hiding this comment

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

LGTM

@jtremback jtremback merged commit b3533f6 into main Feb 1, 2023
@jtremback jtremback deleted the throttle-integration-fixes branch February 1, 2023 22:38
@shaspitz
Copy link
Contributor Author

shaspitz commented Feb 2, 2023

BTW I just tried running the same test with a longer replenish period, and longer timeout. The test still passes if the slashThrottleDequeue timeout is set correctly. Long term it might be worth making the configured replenish period something around ~5 minutes, as this is a more effective test that packets are actually throttled.

ie. with a replenish period of 20 seconds and a block time of 20 seconds, throttling will act no different than allowing a packet to be handled once per block. This is why #684 was not caught by integration tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants