Skip to content

Commit

Permalink
Fix flaky LRU test
Browse files Browse the repository at this point in the history
Try to fix flaky test which was noticed on the MacOS CI worker [1]:

```
[2023-02-17T07:40:34.978Z]     ets_lru_test:285: -test_limits/2-fun-7- (Expire leaves new entries)...ok
[2023-02-17T07:40:34.978Z]     ets_lru_test:292: -test_limits/2-fun-5- (Entry was expired)...*failed*
[2023-02-17T07:40:34.978Z] in function ets_lru_test:'-test_limits/2-fun-5-'/2 (test/ets_lru_test.erl, line 294)
```

[1] #4397 (comment)
  • Loading branch information
nickva committed Mar 4, 2023
1 parent b8abb4a commit 7ec5f64
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ets_lru/test/ets_lru_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ test_limits([{max_lifetime, N}], {ok, LRU}) ->
"Entry was expired",
?_test(begin
timer:sleep(round(N * 1.5)),
test_util:wait(fun() ->
case ets_lru:lookup(LRU, foo) of
not_found -> ok;
_ -> wait
end
end),
?assertEqual(not_found, ets_lru:lookup(LRU, foo))
end)
}
Expand Down

0 comments on commit 7ec5f64

Please sign in to comment.