You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2023/03/04 06:07:15 UTC

[couchdb] branch ets-lru-flaky-test created (now cb98a2198)

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a change to branch ets-lru-flaky-test
in repository https://gitbox.apache.org/repos/asf/couchdb.git


      at cb98a2198 Fix flaky LRU test

This branch includes the following new commits:

     new cb98a2198 Fix flaky LRU test

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: Fix flaky LRU test

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch ets-lru-flaky-test
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit cb98a219835682015e5050713778da3c61eef3bd
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Sat Mar 4 00:59:19 2023 -0500

    Fix flaky LRU test
    
    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] https://github.com/apache/couchdb/issues/4397#issuecomment-1434764920
---
 src/ets_lru/test/ets_lru_test.erl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/ets_lru/test/ets_lru_test.erl b/src/ets_lru/test/ets_lru_test.erl
index 5dd193f8d..be003bee2 100644
--- a/src/ets_lru/test/ets_lru_test.erl
+++ b/src/ets_lru/test/ets_lru_test.erl
@@ -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)
         }