Add task deletion tests where the same task is deleted twice

This commit is contained in:
Loïc Lecrenier 2022-10-15 11:38:43 +02:00 committed by Clément Renault
parent dabc30d3d6
commit d49d7e9c2d
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
5 changed files with 124 additions and 0 deletions

View file

@ -830,6 +830,10 @@ impl IndexScheduler {
let processing_tasks = &self.processing_tasks.read().unwrap().1;
// TODO: Lo: Take the intersection of `matched_tasks` and `all_tasks` first,
// so that we end up with the correct count for `deleted_tasks` (the value returned
// by this function). Related snapshot test:
// `task_deletion_delete_same_task_twice/task_deletion_processed.snap`
let mut to_delete_tasks = matched_tasks - processing_tasks;
to_delete_tasks -= enqueued_tasks;