You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2009/11/26 01:19:02 UTC
svn commit: r884344 - in /couchdb/trunk: share/www/script/test/stats.js
src/couchdb/couch_db_updater.erl
Author: davisp
Date: Thu Nov 26 00:19:02 2009
New Revision: 884344
URL: http://svn.apache.org/viewvc?rev=884344&view=rev
Log:
Update the open db's test to check failure.
Damien made a good point that we should check that the error is generated as expected before waiting as necessary for the active db's to go idle.
Modified:
couchdb/trunk/share/www/script/test/stats.js
couchdb/trunk/src/couchdb/couch_db_updater.erl
Modified: couchdb/trunk/share/www/script/test/stats.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/stats.js?rev=884344&r1=884343&r2=884344&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/stats.js (original)
+++ couchdb/trunk/share/www/script/test/stats.js Thu Nov 26 00:19:02 2009
@@ -88,6 +88,14 @@
var times = [];
for(var i = 0; i < max*2; i++) {
if(i >= max) {
+ if(i == max) {
+ try {
+ newDb("test_suite_db_" + i, true);
+ T(0 === 1, "Should have failed to create max+1 db's quickly.");
+ } catch(e) {
+ T(e.reason == "all_dbs_active", "All db's should be active.");
+ }
+ }
var msecs = (new Date()).getTime() - times[i-max];
if(msecs < 1000) {
CouchDB.request("GET", "/_sleep?time=" + (msecs+250));
Modified: couchdb/trunk/src/couchdb/couch_db_updater.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db_updater.erl?rev=884344&r1=884343&r2=884344&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db_updater.erl (original)
+++ couchdb/trunk/src/couchdb/couch_db_updater.erl Thu Nov 26 00:19:02 2009
@@ -685,7 +685,7 @@
Db2 = Db#db{waiting_delayed_commit=nil,
header=Header,
committed_update_seq=Db#db.update_seq},
- %ok = gen_server:call(Db2#db.main_pid, {db_updated, Db2}),
+ ok = gen_server:call(Db2#db.main_pid, {db_updated, Db2}),
Db2
end.