Blob Blame History Raw
From: Jay Doane <jay.s.doane@gmail.com>
Date: Wed, 26 Jul 2017 11:15:12 -0700
Subject: [PATCH] Increase various eunit test timeouts

Several eunit tests tend to fail by timing out when run on
travis-ci. This change increases timeouts on the more commonly failing
tests, and improves test robustness.

diff --git a/test/couchdb/couch_changes_tests.erl b/test/couchdb/couch_changes_tests.erl
index a129ba2fd..d7519a769 100644
--- a/test/couchdb/couch_changes_tests.erl
+++ b/test/couchdb/couch_changes_tests.erl
@@ -16,7 +16,7 @@
 -include_lib("couchdb/couch_db.hrl").
 
 -define(ADMIN_USER, {user_ctx, #user_ctx{roles = [<<"_admin">>]}}).
--define(TIMEOUT, 3000).
+-define(TIMEOUT, 6000).
 -define(TEST_TIMEOUT, 10000).
 
 -record(row, {
diff --git a/test/couchdb/couchdb_file_compression_tests.erl b/test/couchdb/couchdb_file_compression_tests.erl
index fd3f51352..4aa751929 100644
--- a/test/couchdb/couchdb_file_compression_tests.erl
+++ b/test/couchdb/couchdb_file_compression_tests.erl
@@ -18,7 +18,7 @@
 -define(ADMIN_USER, {user_ctx, #user_ctx{roles=[<<"_admin">>]}}).
 -define(DDOC_ID, <<"_design/test">>).
 -define(DOCS_COUNT, 5000).
--define(TIMEOUT, 30000).
+-define(TIMEOUT, 60000).
 
 
 start() ->
diff --git a/test/couchdb/couchdb_views_tests.erl b/test/couchdb/couchdb_views_tests.erl
index 8c206b9d3..0defc58c7 100644
--- a/test/couchdb/couchdb_views_tests.erl
+++ b/test/couchdb/couchdb_views_tests.erl
@@ -19,6 +19,7 @@
 -define(ADMIN_USER, {user_ctx, #user_ctx{roles=[<<"_admin">>]}}).
 -define(DELAY, 100).
 -define(TIMEOUT, 1000).
+-define(WAIT_DELAY_COUNT, 40).
 
 
 start() ->
@@ -556,7 +557,7 @@ compact_db(DbName) ->
     {ok, Db} = couch_db:open_int(DbName, []),
     {ok, _} = couch_db:start_compact(Db),
     ok = couch_db:close(Db),
-    wait_db_compact_done(DbName, 10).
+    wait_db_compact_done(DbName, ?WAIT_DELAY_COUNT).
 
 wait_db_compact_done(_DbName, 0) ->
     erlang:error({assertion_failed,