Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix flaky jest tests #12486

Merged
merged 1 commit into from
May 2, 2024
Merged

Fix flaky jest tests #12486

merged 1 commit into from
May 2, 2024

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented May 2, 2024

...and remove the code that causes them to be retried in CI. Most of these were just lack of waiting for async things to happen, mostly lazy loading components, hence why they worked on the retry: because the code had been loaded by then.

The highlight here is a test where the expectation was updated in the move to react testing library such that it asserted that the thing had not worked (which it hadn't because we didn't await on the keyboard input). The next test then caught the keyboard input and ended up with text in filter box when it shouldn't have, causing it to fail. It's somewhat shocking that the failure mode of missing an await on keyboard input is so horrendous and non-obvious.

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

...and remove the code that causes them to be retried in CI. Most of
these were just lack of waiting for async things to happen, mostly
lazy loading components, hence whythey worked on the retry: because
the code had been loaded by then.
@dbkr dbkr added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label May 2, 2024
@dbkr dbkr marked this pull request as ready for review May 2, 2024 14:39
@dbkr dbkr requested a review from a team as a code owner May 2, 2024 14:39
@dbkr dbkr requested review from richvdh and florianduros May 2, 2024 14:39
Copy link
Contributor

@florianduros florianduros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh thank you!!!!

@dbkr dbkr added this pull request to the merge queue May 2, 2024
Merged via the queue into develop with commit 374cee9 May 2, 2024
35 checks passed
@dbkr dbkr deleted the dbkr/fix_flaky_jest_tests branch May 2, 2024 15:14
Comment on lines +200 to +202
waitFor(() => {
expect(SdkContextClass.instance.roomViewStore.getThreadId()).toBe(rootEvent.getId());
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs more await ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants