Skip to content

Conversation

@sudo-shashank
Copy link
Contributor

@sudo-shashank sudo-shashank commented Jan 28, 2026

Summary of changes

Changes introduced in this pull request:

  • Use waitForSelector with a timeout instead of page.$() selector to fix flaky k6 browser test.

Reference issue to close (if applicable)

Closes #394

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code
    adheres to the team's
    documentation standards,
  • I have added tests that prove my fix is effective or that my feature works
    (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes
    should be reflected in this document.

Summary by CodeRabbit

  • Chores
    • Improved end-to-end test reliability with enhanced element detection handling.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

The PR modifies the runClaimTests function in the E2E test script to asynchronously wait for an input element with a 10-second timeout before proceeding, replacing a synchronous element query to improve test reliability during claim operations.

Changes

Cohort / File(s) Summary
E2E Test Input Element Wait
e2e/script.js
Changed element retrieval to asynchronous waitForSelector with 10-second timeout instead of direct DOM query, ensuring element presence before interaction

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • hanabi1224
  • akaladarshi

Poem

🐰 A waiter's tale, so fine and grand,
Now waits the element, steady and planned,
Ten seconds given, no rushing ahead,
The test runs smoother, no longer misled! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: replacing flaky input selection with a more reliable selector waiting mechanism in k6 browser tests.
Linked Issues check ✅ Passed The code change addresses the flaky E2E test issue by implementing explicit element waiting, which directly targets the intermittent test failures described in #394.
Out of Scope Changes check ✅ Passed The changes are limited to a single test file (e2e/script.js) with modifications focused on fixing the flaky input selection, remaining within the scope of addressing #394.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.11%. Comparing base (646363c) to head (2f3f0eb).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #395   +/-   ##
=======================================
  Coverage   41.11%   41.11%           
=======================================
  Files          40       40           
  Lines        2668     2668           
=======================================
  Hits         1097     1097           
  Misses       1571     1571           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sudo-shashank sudo-shashank force-pushed the shashank/flaky-e2e-fix branch from 2126334 to 2f3f0eb Compare January 28, 2026 21:01
@sudo-shashank sudo-shashank changed the title Fix flaky E2E browser test Fix flaky input selection in k6 browser tests Jan 28, 2026
@sudo-shashank sudo-shashank marked this pull request as ready for review January 28, 2026 22:18
@sudo-shashank sudo-shashank requested a review from a team as a code owner January 28, 2026 22:18
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@e2e/script.js`:
- Around line 189-193: The waitForSelector call using
page.waitForSelector("input.input", { timeout: 10000 }) can throw on timeout, so
wrap that call in a try-catch (following the pattern used around lines 212-217)
to catch the timeout/error, call check(false, { [`Input exists on ${path}`]: ()
=> false }) or similar to record the failure, and then continue to the next
iteration; ensure the input variable is only used after successful await in the
try block and remove the now-unreachable if (!input) continue; check and logic
from the catch should mirror the existing error handling pattern.

@sudo-shashank sudo-shashank added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit a960aba Jan 29, 2026
19 checks passed
@sudo-shashank sudo-shashank deleted the shashank/flaky-e2e-fix branch January 29, 2026 02:38
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.

E2E Browser Tests failing with threshold violations on 'checks' metric

4 participants