Skip to content

Deflake Section Management UI Step#65020

Merged
Hamms merged 1 commit into
stagingfrom
elijah/deflake-section-id-tests
Apr 4, 2025
Merged

Deflake Section Management UI Step#65020
Hamms merged 1 commit into
stagingfrom
elijah/deflake-section-id-tests

Conversation

@Hamms

@Hamms Hamms commented Apr 3, 2025

Copy link
Copy Markdown
Contributor

One of the UI test steps we use for a few different tests (most significantly, teacher_homepage.feature) has a subtle bug which is causing some flakiness.

Specifically, it is attempting to use the wait_until helper to grab a href value from an asyncronously-populated UI element, but the check its using will always return true, so we will always immediately proceed with the rest of the test. This does not, however, result in a consistent failure; we have other scenarios within that UI test which will also load the relevant data and which are already using a bug-free step to check their own correctness. If any of those scenarios run before the scenario using this step, this step will work fine. Otherwise, it will fail

The simple fix is to use the same check for both steps.

Testing story

Tested extensively locally and in this draft PR. Relying on Drone to test the correctness of my fix, and relying on the repeated reruns and increased overall flakiness of this WIP PR to confirm that it improves test stability.

Links

One of the UI test steps we use for a few different tests (most
significantly,
[`teacher_homepage.feature`](https://github.com/code-dot-org/code-dot-org/blob/staging/dashboard/test/ui/features/teacher_tools/teacher_homepage.feature))
has a subtle bug which is causing some flakiness.

Specifically, it is attempting to use the `wait_until` helper to grab a
`href` value from an asyncronously-populated UI element, but the check
its using will always return true, so we will always immediately proceed
with the rest of the test. This does not, however, result in a
consistent failure; we have other scenarios within that UI test which
will load the relevant data and which [are already using a bug-free
step](https://github.com/code-dot-org/code-dot-org/blob/0ee07a79125036a45de281affd4455c985387b88/dashboard/test/ui/features/step_definitions/section_management_steps.rb#L273)
to check their own correctness. If any of those scenarios run before the
scenario using this step, this step will work fine. Otherwise, [it will
fail](https://cucumber-logs.s3.amazonaws.com/circle/28036/Chrome_teacher_tools_teacher_homepage_output.html?versionId=squ0Qr6sp1xIrWEtB99GABiImDA3YXHD)

The simple fix is to use the same check for both steps.
@Hamms Hamms marked this pull request as ready for review April 3, 2025 23:42
@Hamms Hamms requested review from a team and cearachew and removed request for a team April 3, 2025 23:42

@kobryan0619 kobryan0619 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another win - thanks!

@Hamms Hamms merged commit bdc4d59 into staging Apr 4, 2025
@Hamms Hamms deleted the elijah/deflake-section-id-tests branch April 4, 2025 21:27
@Hamms Hamms added the testing label Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants