[PR #1253] [MERGED] Fix reload_folder_list browser test #1380

Closed
opened 2026-02-25 21:38:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/cypht-org/cypht/pull/1253
Author: @indridieinarsson
Created: 9/24/2024
Status: Merged
Merged: 9/27/2024
Merged by: @Shadow243

Base: masterHead: fix_folder_test


📝 Commits (1)

  • 5a3e849 Fix reload_folder_list browser test

📊 Changes

1 file changed (+17 additions, -3 deletions)

View changed files

📝 tests/selenium/folder_list.py (+17 -3)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cypht-org/cypht/pull/1253 **Author:** [@indridieinarsson](https://github.com/indridieinarsson) **Created:** 9/24/2024 **Status:** ✅ Merged **Merged:** 9/27/2024 **Merged by:** [@Shadow243](https://github.com/Shadow243) **Base:** `master` ← **Head:** `fix_folder_test` --- ### 📝 Commits (1) - [`5a3e849`](https://github.com/cypht-org/cypht/commit/5a3e84977bca5b147c3591dc4c5c7ba946e8a3e8) Fix reload_folder_list browser test ### 📊 Changes **1 file changed** (+17 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/selenium/folder_list.py` (+17 -3) </details> ### 📄 Description ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 21:38:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#1380
No description provided.