Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky playwright test: crypto/event-shields.spec.ts: should show correct shields on events sent by devices which have since been deleted #28061

Closed
RiotRobot opened this issue Sep 17, 2024 · 59 comments · Fixed by element-hq/matrix-react-sdk#143 or #28641
Assignees
Labels
A-E2EE Z-Flaky-Test A test is raising false alarms

Comments

@RiotRobot
Copy link
Contributor

https://github.com/element-hq/matrix-react-sdk/actions/runs/10908576705

@RiotRobot RiotRobot added the Z-Flaky-Test A test is raising false alarms label Sep 17, 2024
@dosubot dosubot bot added the A-E2EE label Sep 17, 2024
@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@dbkr
Copy link
Member

dbkr commented Oct 10, 2024

This has flaked twice in a row for me. If nobody has time to look, I think we'll have to disable it.

@dbkr
Copy link
Member

dbkr commented Oct 10, 2024

ftr, this is:

https://e2e-131--matrix-react-sdk.netlify.app/#?testId=549c35dde3453c6f6198-53d1af2a964b4d8c9a63

Error: jsHandle.evaluate: Error: Cannot encrypt event in unconfigured room !wDXBgADKUDbRHIRBhX:localhost

    at RustCrypto.encryptEvent (http://localhost:8080/bundles/94c04cf2a65f14e9f347/771.js:3276:13)
    at MatrixClient.encryptEventIfNeeded (http://localhost:8080/bundles/94c04cf2a65f14e9f347/init.js:9339:30)
    at async MatrixClient.encryptAndSendEvent (http://localhost:8080/bundles/94c04cf2a65f14e9f347/init.js:9271:9)
    at async <anonymous>:260:30
    at RustCrypto.encryptEvent (/home/runner/work/matrix-react-sdk/matrix-react-sdk/matrix-react-sdk/http:/localhost:8080/bundles/94c04cf2a65f14e9f347/771.js:3276:13)
    at MatrixClient.encryptEventIfNeeded (/home/runner/work/matrix-react-sdk/matrix-react-sdk/matrix-react-sdk/http:/localhost:8080/bundles/94c04cf2a65f14e9f347/init.js:9339:30)
    at async MatrixClient.encryptAndSendEvent (/home/runner/work/matrix-react-sdk/matrix-react-sdk/matrix-react-sdk/http:/localhost:8080/bundles/94c04cf2a65f14e9f347/init.js:9271:9)
    at /home/runner/work/matrix-react-sdk/matrix-react-sdk/matrix-react-sdk/async <anonymous>:260:30
    at Bot.sendMessage (/home/runner/work/matrix-react-sdk/matrix-react-sdk/matrix-react-sdk/playwright/pages/client.ts:125:23)
    at /home/runner/work/matrix-react-sdk/matrix-react-sdk/matrix-react-sdk/playwright/e2e/crypto/event-shields.spec.ts:276:13

ie. the bot client is failing to send a message into the room because it's not ready yet, so probably needs more waiting on the bot side?

@RiotRobot
Copy link
Contributor Author

@richvdh
Copy link
Member

richvdh commented Oct 16, 2024

ugh.

  3) crypto/event-shields.spec.ts:273:13 › Cryptography › event shields › should show correct shields on events sent by devices which have since been deleted 
    Error: Timed out 5000ms waiting for expect(locator).not.toBeVisible()

    Locator: locator('.mx_EventTile').filter({ hasText: 'test encrypted from verified' }).locator('.mx_EventTile_e2eIcon')
    Expected: not visible
    Received: visible
    Call log:
      - expect.not.toBeVisible with timeout 5000ms
      - waiting for locator('.mx_EventTile').filter({ hasText: 'test encrypted from verified' }).locator('.mx_EventTile_e2eIcon')
      -   locator resolved to <div tabindex="0" aria-labelledby="floating-ui-248" aria-label="State of the end-to-end encryption" class="mx_EventTile_e2eIcon mx_EventTile_e2eIcon_warning"></div>
      -   unexpected value "visible"
      -   locator resolved to <div tabindex="0" aria-labelledby="floating-ui-248" aria-label="State of the end-to-end encryption" class="mx_EventTile_e2eIcon mx_EventTile_e2eIcon_warning"></div>
      -   unexpected value "visible"
      -   locator resolved to <div tabindex="0" aria-labelledby="floating-ui-248" aria-label="State of the end-to-end encryption" class="mx_EventTile_e2eIcon mx_EventTile_e2eIcon_warning"></div>
      -   unexpected value "visible"
      -   locator resolved to <div tabindex="0" aria-labelledby="floating-ui-248" aria-label="State of the end-to-end encryption" class="mx_EventTile_e2eIcon mx_EventTile_e2eIcon_warning"></div>
      -   unexpected value "visible"
      -   locator resolved to <div tabindex="0" aria-labelledby="floating-ui-248" aria-label="State of the end-to-end encryption" class="mx_EventTile_e2eIcon mx_EventTile_e2eIcon_warning"></div>
      -   unexpected value "visible"
      -   locator resolved to <div tabindex="0" aria-labelledby="floating-ui-248" aria-label="State of the end-to-end encryption" class="mx_EventTile_e2eIcon mx_EventTile_e2eIcon_warning"></div>
      -   unexpected value "visible"
      -   locator resolved to <div tabindex="0" aria-labelledby="floating-ui-248" aria-label="State of the end-to-end encryption" class="mx_EventTile_e2eIcon mx_EventTile_e2eIcon_warning"></div>
      -   unexpected value "visible"
      -   locator resolved to <div tabindex="0" aria-labelledby="floating-ui-248" aria-label="State of the end-to-end encryption" class="mx_EventTile_e2eIcon mx_EventTile_e2eIcon_warning"></div>
      -   unexpected value "visible"
      -   locator resolved to <div tabindex="0" aria-labelledby="floating-ui-248" aria-label="State of the end-to-end encryption" class="mx_EventTile_e2eIcon mx_EventTile_e2eIcon_warning"></div>
      -   unexpected value "visible"


      306 |
      307 |             const penultimate = page.locator(".mx_EventTile").filter({ hasText: "test encrypted from verified" });
    > 308 |             await expect(penultimate.locator(".mx_EventTile_e2eIcon")).not.toBeVisible();
          |                                                                            ^
      309 |         });
      310 |     });
      311 | });

        at /home/runner/work/matrix-react-sdk/matrix-react-sdk/matrix-react-sdk/playwright/e2e/crypto/event-shields.spec.ts:308:76

It's a different failure mode to before.

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@RiotRobot
Copy link
Contributor Author

@richvdh richvdh self-assigned this Dec 4, 2024
@RiotRobot
Copy link
Contributor Author

richvdh added a commit that referenced this issue Dec 4, 2024
Wait for our user to fetch the bot's identity before running the test, to work
around a race in the shield logic.

Hopefully, fixes #28061
github-merge-queue bot pushed a commit that referenced this issue Dec 4, 2024
* Playwright: improve failure report when an unexpected shield exists

If we discover an E2E shield when we didn't expect one, let's make the error
message more helpful by checking the tooltip.

* Playwright: fix (hopefully) flaky shields test

Wait for our user to fetch the bot's identity before running the test, to work
around a race in the shield logic.

Hopefully, fixes #28061
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE Z-Flaky-Test A test is raising false alarms
Projects
None yet
3 participants