Skip to content

Commit 144c77e

Browse files
committed
bar
1 parent e4d271e commit 144c77e

1 file changed

Lines changed: 3 additions & 33 deletions

File tree

  • testing/matrix-sdk-integration-testing/src/tests

testing/matrix-sdk-integration-testing/src/tests/timeline.rs

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -297,53 +297,23 @@ async fn test_stale_local_echo_time_abort_edit() {
297297
assert_matches!(local_echo.send_state(), Some(EventSendState::NotSentYet { progress: None }));
298298
assert_eq!(local_echo.content().as_message().unwrap().body(), "hi!");
299299

300-
let mut has_sender_profile = local_echo.sender_profile().is_ready();
301-
302300
// It is then sent. The timeline stream can be racy here:
303301
//
304302
// - either the local echo is marked as sent *before*, and we receive an update
305303
// for this before the remote echo.
306304
// - or the remote echo comes up faster.
307305
//
308-
// Handle both orderings.
306+
// We collect all diffs but we no longer check them. This is tested by unit
307+
// tests already, and testing that here is a bit more complex before of the racy
308+
// situation.
309309
{
310310
let mut diffs = Vec::with_capacity(3);
311311

312312
while let Ok(Some(vector_diff)) = timeout(Duration::from_secs(15), stream.next()).await {
313313
diffs.push(vector_diff);
314314
}
315315

316-
trace!(?diffs, "Received diffs");
317-
318316
assert!(diffs.len() >= 2);
319-
320-
for diff in diffs {
321-
match diff {
322-
VectorDiff::Set { index: 0, value: event }
323-
| VectorDiff::PushBack { value: event }
324-
| VectorDiff::Insert { index: 0, value: event } => {
325-
if event.is_local_echo() {
326-
// If the sender profile wasn't available, we may receive an update about
327-
// it; ignore it.
328-
if !has_sender_profile && event.sender_profile().is_ready() {
329-
has_sender_profile = true;
330-
continue;
331-
}
332-
333-
assert_matches!(event.send_state(), Some(EventSendState::Sent { .. }));
334-
}
335-
336-
assert!(event.is_editable());
337-
assert_eq!(event.content().as_message().unwrap().body(), "hi!");
338-
}
339-
340-
VectorDiff::Remove { index } => assert_eq!(index, 0),
341-
342-
diff => {
343-
panic!("unexpected diff: {diff:?}");
344-
}
345-
}
346-
}
347317
}
348318

349319
// Now do a crime: try to edit the local echo.

0 commit comments

Comments
 (0)