Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: wait until there is no pending tasks in compaction_manager_basi…
…c_test before this change, after triggering the compaction, compaction_manager_basic_test waits until the triggered compaction completes. but since the regular compaction is run in a loop which does not stop until either the daemon is stopping, or there is no more sstables to be compacted, or the compaction is disabled. but we only get the input sstables for compaction after swiching to the "pending" state, and acquiring the read lock of the compaction_state, and acquiring the read lock is implemented as an coroutine, so there is chance that coroutine is suspended, and the execution switches to the test. in this case, the test will find that even after the triggered compaction completes, there are still one or more pending compactions. hence the test fails. to address this problem, instead of just waiting for the compaction to complete, we also wait until the number of pending compaction tasks is 0. so that even if the test manages to sneak into the time window, it won't proceed and starting check the compaction manager's stats. Fixes #14865 Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Closes #14889
- Loading branch information