couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject ets-lru commit: updated refs/heads/master to c05488c
Date Wed, 07 Oct 2015 17:28:06 GMT
Repository: couchdb-ets-lru
Updated Branches:
  refs/heads/master 09128046a -> c05488c8b


Fix flaky limits test.

 In the limits test we check statistics with ets:info right after
 eviction. Sometimes ets:info does not update immediately.

 On first failure, delay for 1ms, then try again.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-ets-lru/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-ets-lru/commit/c05488c8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-ets-lru/tree/c05488c8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-ets-lru/diff/c05488c8

Branch: refs/heads/master
Commit: c05488c8b1d7ec1c3554a828e0c9bf2888932ed6
Parents: 0912804
Author: Nick Vatamaniuc <vatamane@gmail.com>
Authored: Wed Oct 7 13:09:33 2015 -0400
Committer: Nick Vatamaniuc <vatamane@gmail.com>
Committed: Wed Oct 7 13:09:33 2015 -0400

----------------------------------------------------------------------
 test/ets_lru_test.erl | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-ets-lru/blob/c05488c8/test/ets_lru_test.erl
----------------------------------------------------------------------
diff --git a/test/ets_lru_test.erl b/test/ets_lru_test.erl
index 8cfefcc..50ba1b6 100644
--- a/test/ets_lru_test.erl
+++ b/test/ets_lru_test.erl
@@ -286,7 +286,15 @@ insert_kvs(_, _, 0, _) ->
 insert_kvs(Info, LRU, Count, Limit) ->
     ets_lru:insert(LRU, Count, 1.5234),
     case ets:info(lru_objects, Info) > Limit of
-        true -> erlang:error(exceeded_limit);
+        true ->
+            % Retry again as eviction statistics
+            % returned by ets:info() can be delayed.
+            timer:sleep(1),
+            case ets:info(lru_objects, Info) > Limit of
+                true ->
+                    erlang:error(exceeded_limit);
+                false -> true
+            end;
         false -> true
     end,
     insert_kvs(Info, LRU, Count - 1, Limit).


Mime
View raw message