From ea36569db12e5821c0d24922e25e94c9e15ca458 Mon Sep 17 00:00:00 2001 From: Nick Vatamaniuc Date: Fri, 12 Mar 2021 01:02:36 -0500 Subject: 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. --- src/couch_views/test/couch_views_active_tasks_test.erl | 3 +++ 1 file changed, 3 insertions(+) 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), []). -- cgit v1.2.1