Skip to content

Adding waits to resolve timing issues on test_devel_sections.py#1016

Open
cathal-bailey wants to merge 2 commits into3scale-qe:mainfrom
cathal-bailey:devel-sections-timing-fix
Open

Adding waits to resolve timing issues on test_devel_sections.py#1016
cathal-bailey wants to merge 2 commits into3scale-qe:mainfrom
cathal-bailey:devel-sections-timing-fix

Conversation

@cathal-bailey
Copy link
Copy Markdown
Collaborator

@cathal-bailey cathal-bailey commented Mar 11, 2026

  • Tests were failing ~50/60% of the time due to race condition/timing issue in dev portal
  • Using @backoff to retry on failed assertions. Pytestmark added to facilitate backoff decorator.
  • Reliability of test greatly improved with this change. No fails observed locally after addition of wait times.

@cathal-bailey cathal-bailey requested a review from a team as a code owner March 11, 2026 08:28
@cathal-bailey cathal-bailey force-pushed the devel-sections-timing-fix branch from 9034ca6 to 1bd967f Compare March 11, 2026 08:51
Copy link
Copy Markdown
Collaborator

@mastastny mastastny left a comment

Choose a reason for hiding this comment

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

We don't use sleep unless it is the only option. In this case, I would rather use backof library, as we do in other tests.

@cathal-bailey
Copy link
Copy Markdown
Collaborator Author

We don't use sleep unless it is the only option. In this case, I would rather use backof library, as we do in other tests.

Okay, I did a quick testsuite search and I saw sleep being used in a couple of places, so I figured a backoff may be over-kill for this change. I can make that update.

style: fix import order for pylint

Replacing sleep with @backoff to implement race condition fix
@cathal-bailey cathal-bailey force-pushed the devel-sections-timing-fix branch from 1bd967f to 8e4e77a Compare March 11, 2026 10:52
@mastastny mastastny requested review from dhlavac and mdujava March 17, 2026 07:08
Copy link
Copy Markdown
Member

@mdujava mdujava left a comment

Choose a reason for hiding this comment

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

This patch contains unnecessary move of pytest.makr.issue and new blank lines

Comment thread testsuite/tests/ui/devel/test_devel_sections.py Outdated
@cathal-bailey
Copy link
Copy Markdown
Collaborator Author

This patch contains unnecessary move of pytest.makr.issue and new blank lines

When I was testing, there appeared to be a conflict between the @backoff and @pytest.mark.skipif("TESTED_VERSION < Version('2.14-dev')"). I moved these decorators to module-level pytestmark block and this resolved the errors I was seeing.

I will remove the unnecessary blank lines and re-commit, and I can also dig deeper into the errors coming from TESTED_VERSION, if you would rather leave the decorators as they were.

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.

3 participants