ExHammer / hammer

An Elixir rate-limiter with pluggable backends
https://hexdocs.pm/hammer/
MIT License
749 stars 42 forks source link

Backend.ETS Tests Failing? #59

Closed JuneKelly closed 1 year ago

JuneKelly commented 1 year ago

I've just tried running the tests locally, and got the following result:

...........

  1) test timeout pruning (ETSTest)
     test/hammer_ets_test.exs:46
     match (=) failed
     code:  assert {:ok, 1} = ETS.count_hit(pid, key, stamp)
     left:  {:ok, 1}
     right: {:ok, 4}
     stacktrace:
       test/hammer_ets_test.exs:50: (test)

....

Finished in 1.1 seconds (0.00s async, 1.1s sync)
16 tests, 1 failure

Randomized with seed 111193

On each run it seems to fail with a slightly different value. I suspect something in the ETS platform has shifted over time, and we need to look into it.

I see the test is also failing in CI: https://github.com/ExHammer/hammer/actions/runs/4780564479/jobs/8498385954

EDIT: I also see the count_hit test failing on some runs too...


  2) test count_hit (ETSTest)
     test/hammer_ets_test.exs:13
     match (=) failed
     code:  assert {:ok, 1} = ETS.count_hit(pid, key, stamp)
     left:  {:ok, 1}
     right: {:ok, 2}
     stacktrace:
       test/hammer_ets_test.exs:16: (test)