akka-http icon indicating copy to clipboard operation
akka-http copied to clipboard

ExpiringLfuCacheSpec: should properly limit capacity

Open raboof opened this issue 4 years ago • 4 comments

https://github.com/akka/akka-http/runs/4393893232?check_suite_focus=true

[info] - should properly limit capacity *** FAILED *** (83 milliseconds)
[info]   4 was not equal to 3 (ExpiringLfuCacheSpec.scala:115)
[info]   org.scalatest.exceptions.TestFailedException:
[info]   at org.scalatest.matchers.MatchersHelper$.indicateFailure(MatchersHelper.scala:344)
[info]   at org.scalatest.matchers.should.Matchers$ShouldMethodHelperClass.shouldMatcher(Matchers.scala:6778)
[info]   at org.scalatest.matchers.should.Matchers$AnyShouldWrapper.should(Matchers.scala:6822)
[info]   at akka.http.caching.ExpiringLfuCacheSpec.$anonfun$new$20(ExpiringLfuCacheSpec.scala:115)

raboof avatar Dec 02 '21 18:12 raboof

https://github.com/akka/akka-http/runs/5713734725?check_suite_focus=true

jrudolph avatar Mar 28 '22 07:03 jrudolph

https://github.com/akka/akka-http/runs/6362762905?check_suite_focus=true#step:7:2272

jrudolph avatar May 10 '22 12:05 jrudolph

https://github.com/akka/akka-http/blob/83f44a79fa2634573c75df642f7b9f109875f09a/akka-http-caching/src/test/scala/akka/http/caching/ExpiringLfuCacheSpec.scala#L114-L115

That is racy, consider awaiting until the size matches within a tolerance period. Otherwise consider using a same thread executor so that evictions are not async in the tests.

ben-manes avatar May 12 '22 02:05 ben-manes

That is racy, consider awaiting until the size matches within a tolerance period. Otherwise consider using a same thread executor so that evictions are not async in the tests.

Good to know. Thanks for chiming in.

jrudolph avatar May 12 '22 09:05 jrudolph

https://github.com/akka/akka-http/actions/runs/3834627463/jobs/6527188551#step:7:2303

johanandren avatar Jan 05 '23 07:01 johanandren