Skip to content

Commit

Permalink
use more docs in view_compaction test to ensure a difference
Browse files Browse the repository at this point in the history
  • Loading branch information
janl committed Dec 5, 2012
1 parent 419a809 commit 56f969b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions share/www/script/test/view_compaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ couchTests.view_compaction = function(debug) {
};
T(db.save(ddoc).ok);

var docs = makeDocs(0, 1000);
var docs = makeDocs(0, 10000);
db.bulkSave(docs);

var resp = db.view('foo/view1', {});
T(resp.rows.length === 1000);
T(resp.rows.length === 10000);

resp = db.view('foo/view2', {});
T(resp.rows.length === 1);

resp = db.designInfo("_design/foo");
T(resp.view_index.update_seq === 1001);
T(resp.view_index.update_seq === 10001);


// update docs
Expand All @@ -55,13 +55,13 @@ couchTests.view_compaction = function(debug) {


resp = db.view('foo/view1', {});
T(resp.rows.length === 1000);
T(resp.rows.length === 10000);

resp = db.view('foo/view2', {});
T(resp.rows.length === 1);

resp = db.designInfo("_design/foo");
T(resp.view_index.update_seq === 2001);
T(resp.view_index.update_seq === 20001);


// update docs again...
Expand All @@ -72,13 +72,13 @@ couchTests.view_compaction = function(debug) {


resp = db.view('foo/view1', {});
T(resp.rows.length === 1000);
T(resp.rows.length === 10000);

resp = db.view('foo/view2', {});
T(resp.rows.length === 1);

resp = db.designInfo("_design/foo");
T(resp.view_index.update_seq === 3001);
T(resp.view_index.update_seq === 30001);

var disk_size_before_compact = resp.view_index.disk_size;
var data_size_before_compact = resp.view_index.data_size;
Expand All @@ -97,13 +97,13 @@ couchTests.view_compaction = function(debug) {


resp = db.view('foo/view1', {});
T(resp.rows.length === 1000);
T(resp.rows.length === 10000);

resp = db.view('foo/view2', {});
T(resp.rows.length === 1);

resp = db.designInfo("_design/foo");
T(resp.view_index.update_seq === 3001);
T(resp.view_index.update_seq === 30001);
T(resp.view_index.disk_size < disk_size_before_compact);
TEquals("number", typeof resp.view_index.data_size, "data size is a number");
T(resp.view_index.data_size < resp.view_index.disk_size, "data size < file size");
Expand Down

0 comments on commit 56f969b

Please sign in to comment.