From 1afd4e9fa1bf75ac2b2fbf417bf901ab5f25cfa3 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 17 Mar 2026 10:35:46 +0100 Subject: [PATCH] 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. --- .../tests/integration/timeline/pagination.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/matrix-sdk-ui/tests/integration/timeline/pagination.rs b/crates/matrix-sdk-ui/tests/integration/timeline/pagination.rs index ca1591189..9da3b58e9 100644 --- a/crates/matrix-sdk-ui/tests/integration/timeline/pagination.rs +++ b/crates/matrix-sdk-ui/tests/integration/timeline/pagination.rs @@ -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());