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:
the site is loaded and checked that the main menu button is available and has the right text.
Then we refresh the message list
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.
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.