Skip to content

Conversation

lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Mar 6, 2024

Rather than wait for one of https://jira.mongodb.org/browse/COMPASS-7695 or https://jira.mongodb.org/browse/COMPASS-7696 or disabling the test in the meantime I just rewrote it to do less and just check that the button works in the shortest number of steps for now.

I think there was also a race condition in there somewhere but I'm pretty confident that it won't affect real users and I've spent weeks debugging this off and on now. I really just want this test to stop flaking regularly because it keeps failing CI.

await browser.pause(1000);
await browser.clickVisible(Selectors.InstanceRefreshDatabaseButton);
// Refresh again and the database card should disappear.
await browser.clickVisible(Selectors.InstanceRefreshDatabaseButton, {
Copy link
Contributor Author

@lerouxb lerouxb Mar 6, 2024

Choose a reason for hiding this comment

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

Sometimes the card doesn't go away. This is now the only time we hit the refresh button so the only thing I can think of is that the initial load is still somehow in progress by the time we hit the refresh button.

// Wait for the page to finish loading as best as we can
await browser.waitUntil(async () => {
const placeholders = await browser.$$(Selectors.DatabaseStatLoader);
return placeholders.length === 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If only we (or a user) could reliably tell in the UI once everything is done loading. 🤔

@lerouxb lerouxb merged commit 318fea1 into main Mar 6, 2024
@lerouxb lerouxb deleted the rewrite-refresh-test branch March 6, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants