From 4804adcef6a3b7e7d55f9567660484f8dec3f12c Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Mon, 25 Sep 2023 12:06:22 +0100 Subject: [PATCH] Fix flaky receipt and redaction tests by pausing between message sends --- cypress/e2e/read-receipts/read-receipts-utils.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cypress/e2e/read-receipts/read-receipts-utils.ts b/cypress/e2e/read-receipts/read-receipts-utils.ts index 2f78b46041f..9bd61967137 100644 --- a/cypress/e2e/read-receipts/read-receipts-utils.ts +++ b/cypress/e2e/read-receipts/read-receipts-utils.ts @@ -262,6 +262,14 @@ export function sendMessageAsClient(cli: MatrixClient, room: string, messages: M await message.performAction(cli, room); } }); + // TODO: without this wait, some tests that send lots of messages flake + // from time to time. I (andyb) have done some investigation, but it + // needs more work to figure out. The messages do arrive over sync, but + // they never appear in the timeline, and they never fire a + // Room.timeline event. I think this only happens with events that refer + // to other events (e.g. replies), so it might be caused by the + // referring event arriving before the referred-to event. + cy.wait(200); } }