You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/02/02 18:44:01 UTC

[GitHub] [couchdb] jiahuili430 opened a new pull request #3923: Execute chttpd_dbs_info_tests in clean database_dir

jiahuili430 opened a new pull request #3923:
URL: https://github.com/apache/couchdb/pull/3923


   <!-- Thank you for your contribution!
   
        Please file this form by replacing the Markdown comments
        with your text. If a section needs no action - remove it.
   
        Also remember, that CouchDB uses the Review-Then-Commit (RTC) model
        of code collaboration. Positive feedback is represented +1 from committers
        and negative is a -1. The -1 also means veto, and needs to be addressed
        to proceed. Once there are no objections, the PR can be merged by a
        CouchDB committer.
   
        See: http://couchdb.apache.org/bylaws.html#decisions for more info. -->
   
   ## Overview
   
   <!-- Please give a short brief for the pull request,
        what problem it solves or how it makes things better. -->
   
   ## Testing recommendations
   
   <!-- Describe how we can test your changes.
        Does it provides any behaviour that the end users
        could notice? -->
   
   ## Related Issues or Pull Requests
   https://github.com/apache/couchdb/pull/3832
   https://github.com/apache/couchdb/pull/3921
   
   <!-- If your changes affects multiple components in different
        repositories please put links to those issues or pull requests here.  -->
   
   ## Checklist
   
   - [ ] Code is written and works correctly
   - [ ] Changes are covered by tests
   - [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
   - [ ] A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] iilyak commented on a change in pull request #3923: Execute chttpd_dbs_info_tests in clean database_dir

Posted by GitBox <gi...@apache.org>.
iilyak commented on a change in pull request #3923:
URL: https://github.com/apache/couchdb/pull/3923#discussion_r798676662



##########
File path: src/chttpd/test/eunit/chttpd_dbs_info_test.erl
##########
@@ -14,358 +14,264 @@
 
 -include_lib("couch/include/couch_eunit.hrl").
 -include_lib("couch/include/couch_db.hrl").
+-include("chttpd_test.hrl").
 
 -define(USER, "chttpd_db_test_admin").
 -define(PASS, "pass").
 -define(AUTH, {basic_auth, {?USER, ?PASS}}).
 -define(CONTENT_JSON, {"Content-Type", "application/json"}).
 
+start() ->
+    Ctx = chttpd_test_util:start_couch(),
+    DbDir = config:get("couchdb", "database_dir"),
+    Suffix = ?b2l(couch_uuids:random()),
+    test_util:with_couch_server_restart(fun() ->
+        config:set("couchdb", "database_dir", DbDir ++ "/" ++ Suffix, false)
+    end),
+    mock([fabric_util, chttpd_util]),
+    Ctx.
+
+stop(Ctx) ->
+    config:delete("couchdb", "database_dir", false),
+    chttpd_test_util:stop_couch(Ctx).
+
 setup() ->
     Hashed = couch_passwords:hash_admin_password(?PASS),
     ok = config:set("admins", ?USER, ?b2l(Hashed), _Persist = false),
-    Addr = config:get("chttpd", "bind_address", "127.0.0.1"),
-    Port = mochiweb_socket_server:get(chttpd, port),
-    Url = lists:concat(["http://", Addr, ":", Port, "/"]),
-    Db1Url = lists:concat([Url, "db1"]),
-    create_db(Db1Url),
-    Db2Url = lists:concat([Url, "db2"]),
-    create_db(Db2Url),
-    mock(fabric_util),
-    mock(chttpd_util),
-    Url.
-
-teardown(Url) ->
+    Suffix = ?b2l(couch_uuids:random()),
+    Db1 = testdb("db1", Suffix),
+    Db2 = testdb("db2", Suffix),
+    create_db(base_url(Db1)),
+    create_db(base_url(Db2)),
+    {Suffix, Db1, Db2}.
+
+teardown({_, Db1, Db2}) ->
     meck:unload(),
-    Db1Url = lists:concat([Url, "db1"]),
-    Db2Url = lists:concat([Url, "db2"]),
-    delete_db(Db1Url),
-    delete_db(Db2Url),
+    config:delete("couchdb", "database_dir", false),

Review comment:
       You delete it in stop already. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] iilyak commented on a change in pull request #3923: Execute chttpd_dbs_info_tests in clean database_dir

Posted by GitBox <gi...@apache.org>.
iilyak commented on a change in pull request #3923:
URL: https://github.com/apache/couchdb/pull/3923#discussion_r799609153



##########
File path: src/chttpd/test/eunit/chttpd_dbs_info_test.erl
##########
@@ -14,358 +14,263 @@
 
 -include_lib("couch/include/couch_eunit.hrl").
 -include_lib("couch/include/couch_db.hrl").
+-include("chttpd_test.hrl").
 
 -define(USER, "chttpd_db_test_admin").
 -define(PASS, "pass").
 -define(AUTH, {basic_auth, {?USER, ?PASS}}).
 -define(CONTENT_JSON, {"Content-Type", "application/json"}).
 
+start() ->
+    Ctx = chttpd_test_util:start_couch(),
+    DbDir = config:get("couchdb", "database_dir"),
+    Suffix = ?b2l(couch_uuids:random()),
+    test_util:with_couch_server_restart(fun() ->
+        config:set("couchdb", "database_dir", DbDir ++ "/" ++ Suffix, false)
+    end),
+    mock([fabric_util, chttpd_util]),
+    Ctx.
+
+stop(Ctx) ->
+    config:delete("couchdb", "database_dir", false),
+    chttpd_test_util:stop_couch(Ctx).
+
 setup() ->
     Hashed = couch_passwords:hash_admin_password(?PASS),
     ok = config:set("admins", ?USER, ?b2l(Hashed), _Persist = false),
-    Addr = config:get("chttpd", "bind_address", "127.0.0.1"),
-    Port = mochiweb_socket_server:get(chttpd, port),
-    Url = lists:concat(["http://", Addr, ":", Port, "/"]),
-    Db1Url = lists:concat([Url, "db1"]),
-    create_db(Db1Url),
-    Db2Url = lists:concat([Url, "db2"]),
-    create_db(Db2Url),
-    mock(fabric_util),
-    mock(chttpd_util),
-    Url.
-
-teardown(Url) ->
+    Suffix = ?b2l(couch_uuids:random()),
+    Db1 = testdb("db1", Suffix),
+    Db2 = testdb("db2", Suffix),
+    create_db(base_url(Db1)),
+    create_db(base_url(Db2)),
+    {Suffix, Db1, Db2}.
+
+teardown({_, Db1, Db2}) ->
     meck:unload(),
-    Db1Url = lists:concat([Url, "db1"]),
-    Db2Url = lists:concat([Url, "db2"]),
-    delete_db(Db1Url),
-    delete_db(Db2Url),
+    delete_db(base_url(Db1)),
+    delete_db(base_url(Db2)),
     ok = config:delete("admins", ?USER, _Persist = false).
 
-create_db(Url) ->
-    {ok, Status, _, _} = test_request:put(Url, [?CONTENT_JSON, ?AUTH], "{}"),
-    ?assert(Status =:= 201 orelse Status =:= 202).
-
-delete_db(Url) ->
-    {ok, 200, _, _} = test_request:delete(Url, [?AUTH]).
-
-mock(Module) ->
-    meck:new(Module, [passthrough]).
-
-mock_timeout() ->
-    meck:expect(fabric_util, request_timeout, fun() -> 0 end).
-
-mock_db_not_exist() ->
-    meck:expect(
-        chttpd_util,
-        get_db_info,
-        fun(_) -> {error, database_does_not_exist} end
-    ).
-
 dbs_info_test_() ->
     {
         "chttpd dbs info tests",
         {
             setup,
-            fun chttpd_test_util:start_couch/0,
-            fun chttpd_test_util:stop_couch/1,
+            fun start/0,
+            fun stop/1,
             {
                 foreach,
                 fun setup/0,
                 fun teardown/1,
                 [
-                    fun get_db_info_should_return_db_info/1,
-                    fun get_db_info_should_return_error_when_db_not_exist/1,
-                    fun get_db_info_should_return_error_when_time_out/1,
-                    fun should_return_error_for_put_dbs_info/1,
-                    fun should_return_dbs_info_for_get_dbs_info/1,
-                    fun should_return_nothing_when_db_not_exist_for_get_dbs_info/1,
-                    fun should_return_500_time_out_when_time_is_not_enough_for_get_dbs_info/1,
-                    fun should_return_db2_for_get_dbs_info_with_descending/1,
-                    fun should_return_db1_for_get_dbs_info_with_limit_1/1,
-                    fun should_return_db2_for_get_dbs_info_with_skip_1/1,
-                    fun should_return_dbs_info_with_correct_start_end_key/1,
-                    fun should_return_empty_list_with_wrong_start_end_key/1,
-                    fun should_return_dbs_info_for_single_db/1,
-                    fun should_return_dbs_info_for_multiple_dbs/1,
-                    fun should_return_error_for_exceeded_keys/1,
-                    fun should_return_error_for_missing_keys/1,
-                    fun should_return_dbs_info_for_dbs_with_mixed_state/1
+                    ?TDEF_FE(get_db_info_should_return_db_info),
+                    ?TDEF_FE(get_db_info_should_return_error_when_db_not_exist),
+                    ?TDEF_FE(get_db_info_should_return_error_when_time_out),
+                    ?TDEF_FE(should_return_error_for_put_dbs_info),
+                    ?TDEF_FE(should_return_dbs_info_for_get_dbs_info),
+                    ?TDEF_FE(should_return_nothing_when_db_not_exist_for_get_dbs_info),
+                    ?TDEF_FE(should_return_500_time_out_when_time_is_not_enough_for_get_dbs_info),
+                    ?TDEF_FE(should_return_db2_for_get_dbs_info_with_descending),
+                    ?TDEF_FE(should_return_db1_for_get_dbs_info_with_limit_1),
+                    ?TDEF_FE(should_return_db2_for_get_dbs_info_with_skip_1),
+                    ?TDEF_FE(should_return_dbs_info_with_correct_start_end_key),
+                    ?TDEF_FE(should_return_empty_list_with_wrong_start_end_key),
+                    ?TDEF_FE(should_return_dbs_info_for_single_db),
+                    ?TDEF_FE(should_return_dbs_info_for_multiple_dbs),
+                    ?TDEF_FE(should_return_error_for_exceeded_keys),
+                    ?TDEF_FE(should_return_error_for_missing_keys),
+                    ?TDEF_FE(should_return_dbs_info_for_dbs_with_mixed_state)
                 ]
             }
         }
     }.
 
-get_db_info_should_return_db_info(_) ->
-    DbInfo = fabric:get_db_info("db1"),
-    ?_assertEqual(DbInfo, chttpd_util:get_db_info("db1")).
+get_db_info_should_return_db_info({_, Db1, _}) ->
+    DbInfo = fabric:get_db_info(Db1),
+    ?assertEqual(DbInfo, chttpd_util:get_db_info(Db1)).
 
 get_db_info_should_return_error_when_db_not_exist(_) ->
-    ?_assertEqual(
+    ?assertEqual(
         {error, database_does_not_exist},
         chttpd_util:get_db_info("db_not_exist")
     ).
 
-get_db_info_should_return_error_when_time_out(_) ->
-    ?_test(
-        begin
-            mock_timeout(),
-            ?assertEqual({error, timeout}, chttpd_util:get_db_info("db1"))
-        end
-    ).
+get_db_info_should_return_error_when_time_out({_, Db1, _}) ->
+    mock_timeout(),
+    ?assertEqual({error, timeout}, chttpd_util:get_db_info(Db1)).
 
-should_return_error_for_put_dbs_info(Url) ->
-    ?_test(
-        begin
-            {ok, Code, _, ResultBody} = test_request:put(
-                Url ++
-                    "_dbs_info",
-                [?CONTENT_JSON, ?AUTH],
-                ""
-            ),
-            {Body} = jiffy:decode(ResultBody),
-            ?assertEqual(405, Code),
-            ?assertEqual(
-                <<"method_not_allowed">>,
-                couch_util:get_value(<<"error">>, Body)
-            )
-        end
-    ).
+should_return_error_for_put_dbs_info(_) ->
+    {ok, Code, _, ResultBody} = test_request:put(
+        dbs_info_url(), [?CONTENT_JSON, ?AUTH], ""
+    ),
+    {Body} = jiffy:decode(ResultBody),
+    ?assertEqual(
+        <<"method_not_allowed">>,
+        couch_util:get_value(<<"error">>, Body)
+    ),
+    ?assertEqual(405, Code).

Review comment:
       Good call!!! Thank you for swapping assertions order. It is way easier to debug failures this way. Because the failed assertion would contain the reason. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] iilyak commented on a change in pull request #3923: Execute chttpd_dbs_info_tests in clean database_dir

Posted by GitBox <gi...@apache.org>.
iilyak commented on a change in pull request #3923:
URL: https://github.com/apache/couchdb/pull/3923#discussion_r799609153



##########
File path: src/chttpd/test/eunit/chttpd_dbs_info_test.erl
##########
@@ -14,358 +14,263 @@
 
 -include_lib("couch/include/couch_eunit.hrl").
 -include_lib("couch/include/couch_db.hrl").
+-include("chttpd_test.hrl").
 
 -define(USER, "chttpd_db_test_admin").
 -define(PASS, "pass").
 -define(AUTH, {basic_auth, {?USER, ?PASS}}).
 -define(CONTENT_JSON, {"Content-Type", "application/json"}).
 
+start() ->
+    Ctx = chttpd_test_util:start_couch(),
+    DbDir = config:get("couchdb", "database_dir"),
+    Suffix = ?b2l(couch_uuids:random()),
+    test_util:with_couch_server_restart(fun() ->
+        config:set("couchdb", "database_dir", DbDir ++ "/" ++ Suffix, false)
+    end),
+    mock([fabric_util, chttpd_util]),
+    Ctx.
+
+stop(Ctx) ->
+    config:delete("couchdb", "database_dir", false),
+    chttpd_test_util:stop_couch(Ctx).
+
 setup() ->
     Hashed = couch_passwords:hash_admin_password(?PASS),
     ok = config:set("admins", ?USER, ?b2l(Hashed), _Persist = false),
-    Addr = config:get("chttpd", "bind_address", "127.0.0.1"),
-    Port = mochiweb_socket_server:get(chttpd, port),
-    Url = lists:concat(["http://", Addr, ":", Port, "/"]),
-    Db1Url = lists:concat([Url, "db1"]),
-    create_db(Db1Url),
-    Db2Url = lists:concat([Url, "db2"]),
-    create_db(Db2Url),
-    mock(fabric_util),
-    mock(chttpd_util),
-    Url.
-
-teardown(Url) ->
+    Suffix = ?b2l(couch_uuids:random()),
+    Db1 = testdb("db1", Suffix),
+    Db2 = testdb("db2", Suffix),
+    create_db(base_url(Db1)),
+    create_db(base_url(Db2)),
+    {Suffix, Db1, Db2}.
+
+teardown({_, Db1, Db2}) ->
     meck:unload(),
-    Db1Url = lists:concat([Url, "db1"]),
-    Db2Url = lists:concat([Url, "db2"]),
-    delete_db(Db1Url),
-    delete_db(Db2Url),
+    delete_db(base_url(Db1)),
+    delete_db(base_url(Db2)),
     ok = config:delete("admins", ?USER, _Persist = false).
 
-create_db(Url) ->
-    {ok, Status, _, _} = test_request:put(Url, [?CONTENT_JSON, ?AUTH], "{}"),
-    ?assert(Status =:= 201 orelse Status =:= 202).
-
-delete_db(Url) ->
-    {ok, 200, _, _} = test_request:delete(Url, [?AUTH]).
-
-mock(Module) ->
-    meck:new(Module, [passthrough]).
-
-mock_timeout() ->
-    meck:expect(fabric_util, request_timeout, fun() -> 0 end).
-
-mock_db_not_exist() ->
-    meck:expect(
-        chttpd_util,
-        get_db_info,
-        fun(_) -> {error, database_does_not_exist} end
-    ).
-
 dbs_info_test_() ->
     {
         "chttpd dbs info tests",
         {
             setup,
-            fun chttpd_test_util:start_couch/0,
-            fun chttpd_test_util:stop_couch/1,
+            fun start/0,
+            fun stop/1,
             {
                 foreach,
                 fun setup/0,
                 fun teardown/1,
                 [
-                    fun get_db_info_should_return_db_info/1,
-                    fun get_db_info_should_return_error_when_db_not_exist/1,
-                    fun get_db_info_should_return_error_when_time_out/1,
-                    fun should_return_error_for_put_dbs_info/1,
-                    fun should_return_dbs_info_for_get_dbs_info/1,
-                    fun should_return_nothing_when_db_not_exist_for_get_dbs_info/1,
-                    fun should_return_500_time_out_when_time_is_not_enough_for_get_dbs_info/1,
-                    fun should_return_db2_for_get_dbs_info_with_descending/1,
-                    fun should_return_db1_for_get_dbs_info_with_limit_1/1,
-                    fun should_return_db2_for_get_dbs_info_with_skip_1/1,
-                    fun should_return_dbs_info_with_correct_start_end_key/1,
-                    fun should_return_empty_list_with_wrong_start_end_key/1,
-                    fun should_return_dbs_info_for_single_db/1,
-                    fun should_return_dbs_info_for_multiple_dbs/1,
-                    fun should_return_error_for_exceeded_keys/1,
-                    fun should_return_error_for_missing_keys/1,
-                    fun should_return_dbs_info_for_dbs_with_mixed_state/1
+                    ?TDEF_FE(get_db_info_should_return_db_info),
+                    ?TDEF_FE(get_db_info_should_return_error_when_db_not_exist),
+                    ?TDEF_FE(get_db_info_should_return_error_when_time_out),
+                    ?TDEF_FE(should_return_error_for_put_dbs_info),
+                    ?TDEF_FE(should_return_dbs_info_for_get_dbs_info),
+                    ?TDEF_FE(should_return_nothing_when_db_not_exist_for_get_dbs_info),
+                    ?TDEF_FE(should_return_500_time_out_when_time_is_not_enough_for_get_dbs_info),
+                    ?TDEF_FE(should_return_db2_for_get_dbs_info_with_descending),
+                    ?TDEF_FE(should_return_db1_for_get_dbs_info_with_limit_1),
+                    ?TDEF_FE(should_return_db2_for_get_dbs_info_with_skip_1),
+                    ?TDEF_FE(should_return_dbs_info_with_correct_start_end_key),
+                    ?TDEF_FE(should_return_empty_list_with_wrong_start_end_key),
+                    ?TDEF_FE(should_return_dbs_info_for_single_db),
+                    ?TDEF_FE(should_return_dbs_info_for_multiple_dbs),
+                    ?TDEF_FE(should_return_error_for_exceeded_keys),
+                    ?TDEF_FE(should_return_error_for_missing_keys),
+                    ?TDEF_FE(should_return_dbs_info_for_dbs_with_mixed_state)
                 ]
             }
         }
     }.
 
-get_db_info_should_return_db_info(_) ->
-    DbInfo = fabric:get_db_info("db1"),
-    ?_assertEqual(DbInfo, chttpd_util:get_db_info("db1")).
+get_db_info_should_return_db_info({_, Db1, _}) ->
+    DbInfo = fabric:get_db_info(Db1),
+    ?assertEqual(DbInfo, chttpd_util:get_db_info(Db1)).
 
 get_db_info_should_return_error_when_db_not_exist(_) ->
-    ?_assertEqual(
+    ?assertEqual(
         {error, database_does_not_exist},
         chttpd_util:get_db_info("db_not_exist")
     ).
 
-get_db_info_should_return_error_when_time_out(_) ->
-    ?_test(
-        begin
-            mock_timeout(),
-            ?assertEqual({error, timeout}, chttpd_util:get_db_info("db1"))
-        end
-    ).
+get_db_info_should_return_error_when_time_out({_, Db1, _}) ->
+    mock_timeout(),
+    ?assertEqual({error, timeout}, chttpd_util:get_db_info(Db1)).
 
-should_return_error_for_put_dbs_info(Url) ->
-    ?_test(
-        begin
-            {ok, Code, _, ResultBody} = test_request:put(
-                Url ++
-                    "_dbs_info",
-                [?CONTENT_JSON, ?AUTH],
-                ""
-            ),
-            {Body} = jiffy:decode(ResultBody),
-            ?assertEqual(405, Code),
-            ?assertEqual(
-                <<"method_not_allowed">>,
-                couch_util:get_value(<<"error">>, Body)
-            )
-        end
-    ).
+should_return_error_for_put_dbs_info(_) ->
+    {ok, Code, _, ResultBody} = test_request:put(
+        dbs_info_url(), [?CONTENT_JSON, ?AUTH], ""
+    ),
+    {Body} = jiffy:decode(ResultBody),
+    ?assertEqual(
+        <<"method_not_allowed">>,
+        couch_util:get_value(<<"error">>, Body)
+    ),
+    ?assertEqual(405, Code).

Review comment:
       Thank you for swapping assertions order. It is way easier to debug failures this way. Because the failed assertion would contain the reason. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] iilyak merged pull request #3923: Execute chttpd_dbs_info_tests in clean database_dir

Posted by GitBox <gi...@apache.org>.
iilyak merged pull request #3923:
URL: https://github.com/apache/couchdb/pull/3923


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] jiahuili430 commented on a change in pull request #3923: Execute chttpd_dbs_info_tests in clean database_dir

Posted by GitBox <gi...@apache.org>.
jiahuili430 commented on a change in pull request #3923:
URL: https://github.com/apache/couchdb/pull/3923#discussion_r798803670



##########
File path: src/chttpd/test/eunit/chttpd_dbs_info_test.erl
##########
@@ -14,358 +14,264 @@
 
 -include_lib("couch/include/couch_eunit.hrl").
 -include_lib("couch/include/couch_db.hrl").
+-include("chttpd_test.hrl").
 
 -define(USER, "chttpd_db_test_admin").
 -define(PASS, "pass").
 -define(AUTH, {basic_auth, {?USER, ?PASS}}).
 -define(CONTENT_JSON, {"Content-Type", "application/json"}).
 
+start() ->
+    Ctx = chttpd_test_util:start_couch(),
+    DbDir = config:get("couchdb", "database_dir"),
+    Suffix = ?b2l(couch_uuids:random()),
+    test_util:with_couch_server_restart(fun() ->
+        config:set("couchdb", "database_dir", DbDir ++ "/" ++ Suffix, false)
+    end),
+    mock([fabric_util, chttpd_util]),
+    Ctx.
+
+stop(Ctx) ->
+    config:delete("couchdb", "database_dir", false),
+    chttpd_test_util:stop_couch(Ctx).
+
 setup() ->
     Hashed = couch_passwords:hash_admin_password(?PASS),
     ok = config:set("admins", ?USER, ?b2l(Hashed), _Persist = false),
-    Addr = config:get("chttpd", "bind_address", "127.0.0.1"),
-    Port = mochiweb_socket_server:get(chttpd, port),
-    Url = lists:concat(["http://", Addr, ":", Port, "/"]),
-    Db1Url = lists:concat([Url, "db1"]),
-    create_db(Db1Url),
-    Db2Url = lists:concat([Url, "db2"]),
-    create_db(Db2Url),
-    mock(fabric_util),
-    mock(chttpd_util),
-    Url.
-
-teardown(Url) ->
+    Suffix = ?b2l(couch_uuids:random()),
+    Db1 = testdb("db1", Suffix),
+    Db2 = testdb("db2", Suffix),
+    create_db(base_url(Db1)),
+    create_db(base_url(Db2)),
+    {Suffix, Db1, Db2}.
+
+teardown({_, Db1, Db2}) ->
     meck:unload(),
-    Db1Url = lists:concat([Url, "db1"]),
-    Db2Url = lists:concat([Url, "db2"]),
-    delete_db(Db1Url),
-    delete_db(Db2Url),
+    config:delete("couchdb", "database_dir", false),

Review comment:
       Forgot to remove it, thanks for the review.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org