diff options
author | Jay Doane <jay.s.doane@gmail.com> | 2018-12-12 22:00:48 -0800 |
---|---|---|
committer | Jay Doane <jay.s.doane@gmail.com> | 2018-12-27 13:07:57 -0800 |
commit | 899b49c572847d9b05d457c1919b883d4a0c0305 (patch) | |
tree | 308300e061f4e9b59183a032e02789f409f3e031 /src/mem3 | |
parent | f29cdb49cac99f82c46aaadd69a6f70b8df4ed53 (diff) | |
download | couchdb-899b49c572847d9b05d457c1919b883d4a0c0305.tar.gz |
Reduce number of behaviour undefined compiler warnings
Move couch_event and mem3 modules earlier in the list of SubDirs to
suppress behaviour undefined warnings.
This has the side effect of running the tests in the new order, which
induces failures in couch_index tests. Those failures are related to
quorum, and can be traced to mem3 seeds tests leaving a _nodes db
containing several node docs in the tmp/data directory, ultimately
resulting in badmatch errors e.g. when a test expects 'ok' but gets
'accepted' instead.
To prevent test failures, a cleanup function is implemented which
deletes any existing "nodes_db" left after test completion.
Diffstat (limited to 'src/mem3')
-rw-r--r-- | src/mem3/test/mem3_seeds_test.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mem3/test/mem3_seeds_test.erl b/src/mem3/test/mem3_seeds_test.erl index 19e007950..ba83b66be 100644 --- a/src/mem3/test/mem3_seeds_test.erl +++ b/src/mem3/test/mem3_seeds_test.erl @@ -12,7 +12,7 @@ -module(mem3_seeds_test). --include_lib("eunit/include/eunit.hrl"). +-include_lib("couch/include/couch_eunit.hrl"). a_test_() -> Tests = [ @@ -29,7 +29,7 @@ empty_seedlist_status_ok() -> ?assertEqual({[]}, couch_util:get_value(seeds, Result)), ?assertEqual(ok, couch_util:get_value(status, Result)) after - application:stop(mem3) + cleanup() end. seedlist_misconfiguration() -> @@ -43,7 +43,7 @@ seedlist_misconfiguration() -> ?assertMatch({_}, couch_util:get_value('couchdb@node2.example.com', Seeds)), ?assertEqual(seeding, couch_util:get_value(status, Result)) after - application:stop(mem3) + cleanup() end. check_nodelist() -> @@ -54,9 +54,14 @@ check_nodelist() -> ?assert(lists:member('couchdb@node1.example.com', Nodes)), ?assert(lists:member('couchdb@node2.example.com', Nodes)) after - application:stop(mem3) + cleanup() end. +cleanup() -> + application:stop(mem3), + Filename = config:get("mem3", "nodes_db", "_nodes") ++ ".couch", + file:delete(filename:join([?BUILDDIR(), "tmp", "data", Filename])). + setup() -> test_util:start_couch([rexi]). |