quickwit
quickwit copied to clipboard
Fix flaky `test_delete_task_planner` test
The error might be linked to the tokio update. Seems like a few tests of the actor framework are failing too.
This failure is interesting.
Here is what is happening in the test just before the assertion:
- we drop the merge operation by calling
drop(tracked_operation)
. The tracked operation is aTrackedObject<MergeOperation>
:
pub struct TrackedObject<T> {
inner: Arc<InnerTrackedObject<T>>,
}
- So drop is doing a call
Arc::drop
, and as there is only one reference, the drop should then callInnerTrackedObject::drop
. This last drop is taking a lock on the inner list of items and should garbage collect items with astrong_count = 0
. - After the drop, we call
observe
on the handle to get the list of ongoing merge operations. And it should be empty, as we call drop before. - But in the test, the assertion
operations.is_empty()
is false.
By reading the code, I didn't understand how the test could fail :/