diff options
author | Nick Vatamaniuc <vatamane@apache.org> | 2021-03-12 01:02:36 -0500 |
---|---|---|
committer | Nick Vatamaniuc <vatamane@apache.org> | 2021-03-22 11:47:03 -0400 |
commit | ea36569db12e5821c0d24922e25e94c9e15ca458 (patch) | |
tree | eeb44abdb74fc7deed5c0f0a4cae602effaac15f | |
parent | 8fd5a1792a5699a94d674680e356a29535a32591 (diff) | |
download | couchdb-use-indexer-grv-for-view-reads.tar.gz |
Clean up indexes after each test case in couch_views_active_tasks_testuse-indexer-grv-for-view-reads
Since with the recent changes there is an extra `do_finalize`
transaction, the test which relied on the `do_update` being called
last and inspecting a mocked active_tasks util call, started failing.
The test mocks and checks active_tasks reporting for changes done. The
first test case completes during the last `do_update` transaction, but
the indexing process continues on with `do_finalize`. And in the
meantime, the second test starts and sees 3 active tasks instead of
2. The extra one being from the first test.
To fix this make sure to clean indexing data and jobs after each test
case.
-rw-r--r-- | src/couch_views/test/couch_views_active_tasks_test.erl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/couch_views/test/couch_views_active_tasks_test.erl b/src/couch_views/test/couch_views_active_tasks_test.erl index b7f36a343..248449359 100644 --- a/src/couch_views/test/couch_views_active_tasks_test.erl +++ b/src/couch_views/test/couch_views_active_tasks_test.erl @@ -55,6 +55,9 @@ foreach_setup() -> foreach_teardown({Db, _}) -> meck:unload(), + fabric2_fdb:transactional(Db, fun(TxDb) -> + couch_views:cleanup_indices(TxDb, []) + end), ok = fabric2_db:delete(fabric2_db:name(Db), []). |