quickwit icon indicating copy to clipboard operation
quickwit copied to clipboard

Fix flaky `test_delete_task_planner` test

Open guilload opened this issue 2 years ago • 2 comments

CI job

guilload avatar Dec 06 '22 20:12 guilload

The error might be linked to the tokio update. Seems like a few tests of the actor framework are failing too.

guilload avatar Dec 06 '22 21:12 guilload

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 a TrackedObject<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 call InnerTrackedObject::drop. This last drop is taking a lock on the inner list of items and should garbage collect items with a strong_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 :/

fmassot avatar Dec 11 '22 21:12 fmassot