couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [16/47] couchdb commit: updated refs/heads/Update-Sidebar-Ui to c173e52
Date Mon, 19 May 2014 16:17:34 GMT
Fix race condition in test suite on checking ref count

The issue happened from time to time on CentOS system: one, two or few
tests failed because ref count wasn't decremented till the very moment
when this value was requested and the result returned back. Adding
sleep timeout helps to synchronise calls and while 0.1 sec sleep is
good, but not enough - with 0.2 sleep floating errors happens no more.


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

Branch: refs/heads/Update-Sidebar-Ui
Commit: 3442ec5e82370ca66fbb42b985bc9150eee0b42c
Parents: 0bb567f
Author: Alexander Shorin <kxepal@apache.org>
Authored: Wed Apr 30 00:11:41 2014 +0400
Committer: Alexander Shorin <kxepal@apache.org>
Committed: Wed Apr 30 00:17:15 2014 +0400

----------------------------------------------------------------------
 test/etap/200-view-group-no-db-leaks.t | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3442ec5e/test/etap/200-view-group-no-db-leaks.t
----------------------------------------------------------------------
diff --git a/test/etap/200-view-group-no-db-leaks.t b/test/etap/200-view-group-no-db-leaks.t
index b711ac8..9583d09 100755
--- a/test/etap/200-view-group-no-db-leaks.t
+++ b/test/etap/200-view-group-no-db-leaks.t
@@ -212,6 +212,7 @@ get_db_ref_counter() ->
 check_db_ref_count() ->
     {ok, #db{fd_ref_counter = Ref} = Db} = couch_db:open_int(test_db_name(), []),
     ok = couch_db:close(Db),
+    timer:sleep(200),  % sleep a bit to prevent race condition
     etap:is(couch_ref_counter:count(Ref), 2,
         "DB ref counter is only held by couch_db and couch_db_updater"),
     ok.


Mime
View raw message