This is an automated email from the ASF dual-hosted git repository. nickva pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit c82fe8ffb3e5169d78be4cae6696ed0a3908b935 Author: Nick Vatamaniuc <[email protected]> AuthorDate: Wed Apr 29 04:14:10 2026 -0400 Make view compaction tests unflaky It turns after we made view updates more efficient, some view compaction tests started to flake out because they relied on view builds batching inneficiently always and creating garbage between the batches. To fix it, do not rely on inneficient batching, instead just do another explicit fresh and update, this should guarantee at least some extra garbage being created in the tree. --- src/couch/test/eunit/couchdb_file_compression_tests.erl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/couch/test/eunit/couchdb_file_compression_tests.erl b/src/couch/test/eunit/couchdb_file_compression_tests.erl index 1016cd2de..c3ec4174a 100644 --- a/src/couch/test/eunit/couchdb_file_compression_tests.erl +++ b/src/couch/test/eunit/couchdb_file_compression_tests.erl @@ -70,6 +70,14 @@ setup() -> {ok, _} = couch_db:update_doc(Db, DDoc, []), ok = couch_db:close(Db), ok = refresh_index(DbName), + % Another update and refresh. A forced second b-tree update will guarantee + % to create garbage so compaction has something to chew on. Otherwise a + % single bulk build can pack the tree optimally so compact_view won't have + % anything to do. + {ok, Db2} = couch_db:open_int(DbName, [?ADMIN_CTX]), + ok = populate_db(Db2, ?DOCS_COUNT), + ok = couch_db:close(Db2), + ok = refresh_index(DbName), DbName. teardown(DbName) ->
