Skip to content

test: adds tiny delay before placing a bet to avoid race conditions#25093

Merged
christopherferreira9 merged 1 commit intomainfrom
cferreira/improve-predictiont-test
Jan 23, 2026
Merged

test: adds tiny delay before placing a bet to avoid race conditions#25093
christopherferreira9 merged 1 commit intomainfrom
cferreira/improve-predictiont-test

Conversation

@christopherferreira9
Copy link
Copy Markdown
Contributor

@christopherferreira9 christopherferreira9 commented Jan 23, 2026

Description

A race condition between placing a bet and getting the full details for that same bet is causing flakiness on the place best test.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Improves e2e stability around placing a bet in Predict flow.

  • Adds delay: 1000 to tapOpenPosition() when tapping PLACE_BET_BUTTON to allow position values to stabilize before the tap
  • No app logic changes; only e2e page-object adjustment in PredictDetailsPage.ts

Written by Cursor Bugbot for commit 58f2193. This will update automatically on new commits. Configure here.

@christopherferreira9 christopherferreira9 requested a review from a team as a code owner January 23, 2026 10:29
@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@christopherferreira9 christopherferreira9 added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Jan 23, 2026
@metamaskbot metamaskbot added the team-qa QA team label Jan 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

The change is a minor modification to the E2E test page object PredictDetailsPage.ts. It adds a delay: 1000 parameter to the tapOpenPosition() method to ensure position values are stabilized before tapping the "Place bet" button. This is a test stability improvement, not a functional change.

The PredictDetailsPage is used by several prediction-related test specs:

  • predict-open-position.spec.ts (directly uses tapOpenPosition())
  • predict-cash-out.spec.ts
  • predict-claim-positions.spec.ts
  • predict-geo-restriction.spec.ts
  • predict-existing-polymarket-balance.spec.ts

All these tests are tagged with SmokePredictions. Since this is a test infrastructure change that only affects the Predictions feature tests, running SmokePredictions is sufficient to validate that the change works correctly and doesn't break any existing tests.

No application code is modified, so there's no risk to other features. The change is isolated to the Predictions E2E test infrastructure.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@christopherferreira9 christopherferreira9 added this pull request to the merge queue Jan 23, 2026
Merged via the queue into main with commit 6325038 Jan 23, 2026
109 checks passed
@christopherferreira9 christopherferreira9 deleted the cferreira/improve-predictiont-test branch January 23, 2026 15:40
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
@metamaskbot metamaskbot added the release-7.64.0 Issue or pull request that will be included in release 7.64.0 label Jan 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.64.0 Issue or pull request that will be included in release 7.64.0 size-XS team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants