You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/07/13 16:27:53 UTC
ets-lru commit: updated refs/heads/670-fix-flaky-test to 8c64f20
Repository: couchdb-ets-lru
Updated Branches:
refs/heads/670-fix-flaky-test [created] 8c64f2056
Fix flaky tests
The bad options test had a race condition between the process exit and
the unregistering of the name. If the unregister didn't happen quickly
enough then the next bad options test would break with an
already_started error.
Fixes apache/couchdb#670
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/8c64f205
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-ets-lru/tree/8c64f205
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-ets-lru/diff/8c64f205
Branch: refs/heads/670-fix-flaky-test
Commit: 8c64f20565bed7599ec8e2b7561f0636ccee2bb5
Parents: 1376e50
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Jul 13 11:24:45 2017 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Thu Jul 13 11:24:45 2017 -0500
----------------------------------------------------------------------
test/ets_lru_test.erl | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-ets-lru/blob/8c64f205/test/ets_lru_test.erl
----------------------------------------------------------------------
diff --git a/test/ets_lru_test.erl b/test/ets_lru_test.erl
index 50ba1b6..912f6b7 100644
--- a/test/ets_lru_test.erl
+++ b/test/ets_lru_test.erl
@@ -138,9 +138,9 @@ basic_behavior_test_() ->
}
}.
-lru_options_test_() ->
+lru_good_options_test_() ->
{
- "Test LRU options",
+ "Test good LRU options",
{foreachx,
fun(Opts) ->
process_flag(trap_exit,true),
@@ -156,7 +156,28 @@ lru_options_test_() ->
{[{max_size, 2342923423942309423094}], fun test_good_opts/2},
{[{max_lifetime, 1}], fun test_good_opts/2},
{[{max_lifetime, 5}], fun test_good_opts/2},
- {[{max_lifetime, 1244209909180928348}], fun test_good_opts/2},
+ {[{max_lifetime, 1244209909180928348}], fun test_good_opts/2}
+ ]
+ }
+ }.
+
+lru_bad_options_test_() ->
+ {
+ "Test bad LRU options",
+ {foreachx,
+ fun(Opts) ->
+ process_flag(trap_exit,true),
+ ets_lru:start_link(?MODULE, Opts)
+ end,
+ fun(_, Cfg) ->
+ case whereis(?MODULE) of
+ Pid when is_pid(Pid) ->
+ stop_lru({ok, Pid});
+ undefined ->
+ ok
+ end
+ end,
+ [
{[{bingo, bango}], fun test_bad_opts/2},
{[12], fun test_bad_opts/2},
{[true], fun test_bad_opts/2}