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

Fix reload_folder_list browser test #1253

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

indridieinarsson
Copy link
Contributor

Pullrequest

Recently, the reload_folder_list selenium test started randomly failing.
Sometimes it passed, sometimes it failed.
My (un)educated guess is that this is a race condition.
Basically:

  1. the site is loaded and checked that the main menu button is available and has the right text.
  2. Then we refresh the message list
  3. Afterwards, we ensure that the button is still there, and with the right text.

Thing is, after (2), the site is reloaded, the old element in the page becomes stale and a new one is created in its place (my understanding of DOM and browser engines is limited, but that's how I understand it...).
So it depends on execution speed, and how long it takes to load the message list whether or not the menu button has been re-created once we check for it the second time, it (3).

This PR explicitly waits for the menu button to become stale. Then waits for it to become present again. There are timeouts for both waits, so the test will fail with a timeout error if either condition is not met within the timeout, which are rather randomly set at 20 and 10 seconds, respectively.

How2Test

Check that this actually fixes the test.
Guess the test runs have to be initiated a few times for it to be reliably confirmed, as the underlying issue is not deterministic, and the test tails only fails sometimes.

@Shadow243 Shadow243 merged commit a31aad7 into cypht-org:master Sep 27, 2024
6 checks passed
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