Fix reload_folder_list browser test #1253
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.