timer/test: Use const for constants
Some checks failed
Tests and linters / Run gofumpt (pull_request) Successful in 2m18s
DCO action / DCO (pull_request) Failing after 2m34s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m51s
Tests and linters / Staticcheck (pull_request) Successful in 4m2s
Tests and linters / gopls check (pull_request) Successful in 4m6s
Build / Build Components (pull_request) Successful in 4m55s
Tests and linters / Lint (pull_request) Successful in 5m4s
Vulncheck / Vulncheck (pull_request) Successful in 5m2s
Tests and linters / Tests (pull_request) Successful in 7m10s
Tests and linters / Tests with -race (pull_request) Successful in 7m12s

Make it easy to see what the test is about.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-11-20 10:55:24 +03:00
parent 28b7188ffb
commit 35941babb8
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg

View file

@ -18,7 +18,7 @@ func tickN(t *timer.BlockTimer, n uint32) {
// "resetting" consists of ticking the current height as well and invoking `Reset`.
func TestIRBlockTimer_Reset(t *testing.T) {
var baseCounter [2]int
blockDur := uint32(3)
const blockDur = uint32(3)
bt1 := timer.NewBlockTimer(
func() (uint32, error) { return blockDur, nil },
@ -82,7 +82,7 @@ func TestBlockTimer_ResetChangeDuration(t *testing.T) {
}
func TestBlockTimer(t *testing.T) {
blockDur := uint32(10)
const blockDur = uint32(10)
baseCallCounter := uint32(0)
bt := timer.NewBlockTimer(timer.StaticBlockMeter(blockDur), func() {