You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2019/02/22 17:28:23 UTC
[couchdb-khash] 16/25: Remove flaky eunit test.
This is an automated email from the ASF dual-hosted git repository.
jaydoane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-khash.git
commit 7c6a9cd9776b5c6f063ccafedfa984b00877b019
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Mon Oct 12 12:49:25 2015 -0400
Remove flaky eunit test.
This test is a race benchmark to prove khash is faster than dict. It was used in early stages of development. In the context of eunit tests it has the potential to fail occasionally and make test suite results unreliable.
COUCHDB-2848
---
test/khash_test.erl | 57 -----------------------------------------------------
1 file changed, 57 deletions(-)
diff --git a/test/khash_test.erl b/test/khash_test.erl
index d1bb9e2..cc7a429 100644
--- a/test/khash_test.erl
+++ b/test/khash_test.erl
@@ -107,39 +107,6 @@ randomized_test_() ->
}
}.
-compare_dict_test_() ->
- {
- "khash vs dict",
- {setup,
- fun() ->
- % Let the VM settle for a bit
- receive after 1000 -> ok end
- end,
- fun(ok) ->
- [{timeout, ?TIMEOUT, {
- "Dict's fetch is slower than of khash",
- ?_test(begin
- {DTime, _} = timer:tc(fun() -> dict_fetch() end, []),
- {KTime, _} = timer:tc(fun() -> khash_fetch() end, []),
- ?debugFmt("Dict: ~10b", [DTime]),
- ?debugFmt("KHash: ~10b", [KTime]),
- ?assert(DTime > KTime)
- end)
- }},
- {timeout, ?TIMEOUT, {
- "Dict's store is slower than of khash",
- ?_test(begin
- {DTime, _} = timer:tc(fun() -> dict_store() end, []),
- {KTime, _} = timer:tc(fun() -> khash_store() end, []),
- ?debugFmt("Dict: ~10b", [DTime]),
- ?debugFmt("KHash: ~10b", [KTime]),
- ?assert(DTime > KTime)
- end)
- }}]
- end
- }
- }.
-
basic_iterators_test_() ->
{
"khash itrators basics operations",
@@ -286,19 +253,6 @@ no_expiration_iterators_test_() ->
}
}.
-
-dict_fetch() ->
- erlang:garbage_collect(),
- List = kv_data(?NUM_KVS),
- Dict = dict:from_list(List),
- dict_fetch(Dict, ?NUM_CYCLES * 10).
-
-dict_fetch(_, 0) ->
- ok;
-dict_fetch(Dict, NumCycles) ->
- ?assertMatch(1, dict:fetch(1, Dict)),
- dict_fetch(Dict, NumCycles - 1).
-
khash_fetch() ->
erlang:garbage_collect(),
List = kv_data(?NUM_KVS),
@@ -311,17 +265,6 @@ khash_fetch(KHash, NumCycles) ->
?assertMatch(1, khash:get(KHash, 1)),
khash_fetch(KHash, NumCycles - 1).
-dict_store() ->
- List = kv_data(?NUM_KVS * 2),
- Dict = dict:from_list(List),
- dict_store(Dict, ?NUM_CYCLES).
-
-dict_store(_, 0) ->
- ok;
-dict_store(Dict, NumCycles) ->
- Dict2 = dict:store(1, 1, Dict),
- dict_store(Dict2, NumCycles - 1).
-
khash_store() ->
List = kv_data(?NUM_KVS * 2),
{ok, KHash} = khash:from_list(List),