Skip to content

Conversation

@Anemy
Copy link
Member

@Anemy Anemy commented Aug 18, 2025

Aiming to fix the flake where the values from the documents list aren't what we're expecting.
Example of that flake: https://spruce.mongodb.com/task/10gen_compass_main_test_packaged_app_rhel_test_packaged_app_2_749435b5184979e826c7f16910f1d57ef47202b9_25_08_18_14_12_44/tests?execution=0&sorts=STATUS%3AASC

Here's the line that has been flaking:

expect(modifiedResult.phoneNumber).to.be.equal('"10101010"');

There are 2 flakes with this line and the line above it that have been happening.

Looking at the waitForResult implementation in run-find it's checking that the getQueryId gets updated, not actually the documents list updating in the dom. I'm thinking waiting for animations here will ensure that any virtualization or rendering that happens at a slight delay after the results are in will be taken into account.

Copilot AI review requested due to automatic review settings August 18, 2025 19:42
@Anemy Anemy requested a review from a team as a code owner August 18, 2025 19:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses test flakiness in e2e tests by adding proper wait conditions for document rendering animations. The changes ensure that virtualized document lists have fully rendered before test assertions are made.

  • Adds waitForAnimations call for document results after query execution
  • Introduces consistent document-list test ID across different document view components
  • Improves test reliability by accounting for virtualization delays

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/compass-e2e-tests/helpers/selectors.ts Adds DocumentList selector for test targeting
packages/compass-e2e-tests/helpers/commands/run-find.ts Implements waitForAnimations logic for Documents tab
packages/compass-crud/src/components/virtualized-document-json-view.tsx Adds data-testid for virtualized document list
packages/compass-crud/src/components/table-view/document-table-view.tsx Adds data-testid for table view document list

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Anemy Anemy added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Aug 18, 2025
@Anemy Anemy merged commit bfd0ab4 into main Aug 19, 2025
59 checks passed
@Anemy Anemy deleted the add-wait-for-animations-for-crud-docs-e2e branch August 19, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants