Fix flaky rate_limit test (#3615)

This commit is contained in:
ruslandoga 2023-12-12 15:58:20 +08:00 committed by GitHub
parent 7b5c20db17
commit 26809bfd2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ defmodule Plausible.RateLimitTest do
assert {:allow, 1} = RateLimit.check_rate(@table, key, scale, limit)
assert [{{^key, _bucket}, _count = 1, expires_at}] = :ets.tab2list(@table)
assert expires_at > System.system_time(:millisecond)
assert expires_at >= System.system_time(:millisecond)
assert expires_at <= System.system_time(:millisecond) + 50
:timer.sleep(150)