fix(test): fix test_back_pagination_aborted expectations

Even though the task which started the back-pagination is aborted, since
it's now the event cache owning it, it keeps on running in the
background.
This commit is contained in:
Benjamin Bouvier
2026-03-17 10:35:46 +01:00
parent b5153a8b23
commit 1afd4e9fa1

View File

@@ -1027,11 +1027,16 @@ async fn test_back_pagination_aborted() {
// Abort the pagination!
paginate.abort();
// The task should finish with a cancellation.
// The spawned task should finish with a cancellation.
assert!(paginate.await.unwrap_err().is_cancelled());
// The timeline should automatically reset to idle.
assert_next_eq!(back_pagination_status, PaginationStatus::Idle { hit_timeline_start: false });
// But since the pagination task is owned by the event cache, it continues in
// the background!
assert_let_timeout!(
Duration::from_secs(10),
Some(PaginationStatus::Idle { hit_timeline_start }) = back_pagination_status.next()
);
assert!(hit_timeline_start.not());
// And there should be no other pending pagination status updates.
assert!(back_pagination_status.next().now_or_never().is_none());