couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject [11/50] [abbrv] couch commit: updated refs/heads/1963-eunit-bigcouch to 95bfc03
Date Fri, 15 Aug 2014 20:24:38 GMT
Port 077-couch-db-fast-db-delete-create.t etap test suite to eunit

Merged into couch_db_tests suite.


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

Branch: refs/heads/1963-eunit-bigcouch
Commit: f51ec464f735f5a30d7772f93e200b7b2e02417e
Parents: 0511102
Author: Alexander Shorin <kxepal@apache.org>
Authored: Thu May 22 20:31:09 2014 +0400
Committer: Russell Branca <chewbranca@apache.org>
Committed: Fri Aug 15 13:23:43 2014 -0700

----------------------------------------------------------------------
 test/couchdb/couch_db_tests.erl | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/f51ec464/test/couchdb/couch_db_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb/couch_db_tests.erl b/test/couchdb/couch_db_tests.erl
index 2b781ed..3089714 100644
--- a/test/couchdb/couch_db_tests.erl
+++ b/test/couchdb/couch_db_tests.erl
@@ -14,9 +14,12 @@
 
 -include("couch_eunit.hrl").
 
+-define(TIMEOUT, 120).
+
 
 setup() ->
     {ok, _} = couch_server_sup:start_link(?CONFIG_CHAIN),
+    couch_config:set("log", "include_sasl", "false", false),
     ok.
 
 teardown(_) ->
@@ -33,7 +36,8 @@ create_delete_db_test_()->
                 [should_create_db(),
                  should_delete_db(),
                  should_create_multiple_dbs(),
-                 should_delete_multiple_dbs()]
+                 should_delete_multiple_dbs(),
+                 should_create_delete_database_continuously()]
             end
         }
     }.
@@ -88,3 +92,23 @@ should_delete_multiple_dbs() ->
     end, 0, DbNames),
 
     ?_assertEqual(NumDeleted, 6).
+
+should_create_delete_database_continuously() ->
+    DbName = ?tempdb(),
+    {ok, Db} = couch_db:create(DbName, []),
+    couch_db:close(Db),
+    [{timeout, ?TIMEOUT, {integer_to_list(N) ++ " times",
+                           ?_assert(loop(DbName, N))}}
+     || N <- [10, 100, 1000]].
+
+loop(_, 0) ->
+    true;
+loop(DbName, N) ->
+    ok = cycle(DbName),
+    loop(DbName, N - 1).
+
+cycle(DbName) ->
+    ok = couch_server:delete(DbName, []),
+    {ok, Db} = couch_db:create(DbName, []),
+    couch_db:close(Db),
+    ok.


Mime
View raw message