couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject couchdb-khash git commit: Remove flaky eunit test.
Date Tue, 13 Oct 2015 19:23:32 GMT
Repository: couchdb-khash
Updated Branches:
  refs/heads/master fc1a80fe3 -> 7c6a9cd97


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


Project: http://git-wip-us.apache.org/repos/asf/couchdb-khash/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-khash/commit/7c6a9cd9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-khash/tree/7c6a9cd9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-khash/diff/7c6a9cd9

Branch: refs/heads/master
Commit: 7c6a9cd9776b5c6f063ccafedfa984b00877b019
Parents: fc1a80f
Author: Nick Vatamaniuc <vatamane@gmail.com>
Authored: Mon Oct 12 12:49:25 2015 -0400
Committer: Nick Vatamaniuc <vatamane@gmail.com>
Committed: Mon Oct 12 13:20:39 2015 -0400

----------------------------------------------------------------------
 test/khash_test.erl | 57 ------------------------------------------------
 1 file changed, 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-khash/blob/7c6a9cd9/test/khash_test.erl
----------------------------------------------------------------------
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),


Mime
View raw message