karlseguin / ccache

A golang LRU Cache for high concurrency
MIT License
1.31k stars 121 forks source link

fix: flaky test #92

Open miparnisari opened 1 year ago

miparnisari commented 1 year ago

Issue #1: the linter is reporting an error

[27/11/23 10:15:28] ~/GitHub/ccache (master) $ make l
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && golangci-lint run
cache_test.go:411:14: SA4008: variable in loop condition never changes (staticcheck)
        for i := 0; i < 1000000; i++ {
                    ^
make: *** [l] Error 1

Issue #2: the test is flaky

-test.run ^\QTest_ConcurrentClearAndSet\E$
=== RUN   Test_ConcurrentClearAndSet
    cache_test.go:456: cache list and lookup are not consistent in iteration 11840
--- FAIL: Test_ConcurrentClearAndSet (7.11s)