diff options
author | Nick Vatamaniuc <vatamane@apache.org> | 2021-03-12 01:02:36 -0500 |
---|---|---|
committer | Nick Vatamaniuc <nickva@users.noreply.github.com> | 2021-03-23 15:24:27 -0400 |
commit | 2f23dcb43a92c924301454a7b8c53e5bce9ef31d (patch) | |
tree | 5078c0a6c6d119e389b51c6208ded9ffb6d2da38 | |
parent | a1a3ca02b16c7175d05863468ef7398a44707818 (diff) | |
download | couchdb-2f23dcb43a92c924301454a7b8c53e5bce9ef31d.tar.gz |
Clean up indexes after each test case in couch_views_active_tasks_test
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), []). |