Updated Branches: refs/heads/1.2.x 45a7dcdb1 -> 623e4950e
Fix very slow test test/etap/220-compaction-daemon.t After the recent change in the view updater that ensures the view updater's writer process collects larger batches of map values to write into the index, the test's desired fragmentation of 70% takes much more time to happen. To fix this, simply decreased the target fragmentation. (patch by Filipe) Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/623e4950 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/623e4950 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/623e4950 Branch: refs/heads/1.2.x Commit: 623e4950e840b9083666c43053cb6e11a71078c5 Parents: 45a7dcd Author: Jan Lehnardt <[email protected]> Authored: Mon Mar 12 19:16:25 2012 +0100 Committer: Jan Lehnardt <[email protected]> Committed: Mon Mar 12 19:16:25 2012 +0100 ---------------------------------------------------------------------- test/etap/220-compaction-daemon.t | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/623e4950/test/etap/220-compaction-daemon.t ---------------------------------------------------------------------- diff --git a/test/etap/220-compaction-daemon.t b/test/etap/220-compaction-daemon.t index 116d65f..a241dbc 100755 --- a/test/etap/220-compaction-daemon.t +++ b/test/etap/220-compaction-daemon.t @@ -48,7 +48,7 @@ test() -> add_design_doc(Db), couch_db:close(Db), - populate(70, 70, 200 * 1024), + populate(50, 20, 100 * 1024), {_, DbFileSize} = get_db_frag(), {_, ViewFileSize} = get_view_frag(), @@ -59,7 +59,7 @@ test() -> ok = couch_config:set( "compactions", binary_to_list(test_db_name()), - "[{db_fragmentation, \"70%\"}, {view_fragmentation, \"70%\"}]", + "[{db_fragmentation, \"50%\"}, {view_fragmentation, \"20%\"}]", false), ok = timer:sleep(4000), % something >= check_interval @@ -68,33 +68,33 @@ test() -> {DbFrag2, DbFileSize2} = get_db_frag(), {ViewFrag2, ViewFileSize2} = get_view_frag(), - etap:is(true, (DbFrag2 < 70), "Database fragmentation is < 70% after compaction"), - etap:is(true, (ViewFrag2 < 70), "View fragmentation is < 70% after compaction"), + etap:is(true, (DbFrag2 < 50), "Database fragmentation is < 50% after compaction"), + etap:is(true, (ViewFrag2 < 20), "View fragmentation is < 20% after compaction"), etap:is(true, (DbFileSize2 < DbFileSize), "Database file size decreased"), etap:is(true, (ViewFileSize2 < ViewFileSize), "View file size decreased"), disable_compact_daemon(), ok = timer:sleep(6000), % 2 times check_interval etap:is(couch_db:is_idle(Db), true, "Database is idle"), - populate(70, 70, 200 * 1024), - {_, DbFileSize3} = get_db_frag(), - {_, ViewFileSize3} = get_view_frag(), + populate(50, 20, 100 * 1024), + {_DbFrag3, DbFileSize3} = get_db_frag(), + {_ViewFrag3, ViewFileSize3} = get_view_frag(), % enable automatic compaction ok = couch_config:set( "compactions", "_default", - "[{db_fragmentation, \"70%\"}, {view_fragmentation, \"70%\"}]", + "[{db_fragmentation, \"50%\"}, {view_fragmentation, \"20%\"}]", false), - ok = timer:sleep(4000), % something >= check_interval + ok = timer:sleep(6000), % something >= check_interval wait_compaction_finished(), {DbFrag4, DbFileSize4} = get_db_frag(), {ViewFrag4, ViewFileSize4} = get_view_frag(), - etap:is(true, (DbFrag4 < 70), "Database fragmentation is < 70% after compaction"), - etap:is(true, (ViewFrag4 < 70), "View fragmentation is < 70% after compaction"), + etap:is(true, (DbFrag4 < 50), "Database fragmentation is < 50% after compaction"), + etap:is(true, (ViewFrag4 < 20), "View fragmentation is < 20% after compaction"), etap:is(true, (DbFileSize4 < DbFileSize3), "Database file size decreased again"), etap:is(true, (ViewFileSize4 < ViewFileSize3), "View file size decreased again"),
