Skip to content

fix: proxy spec flake in firefox due to improper sweeping and correlation #31651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

AtofStryker
Copy link
Contributor

@AtofStryker AtofStryker commented May 6, 2025

Additional details

While revisiting the proxy spec issues, I found two issues. One of them addresses the flake.

Since cdpRequestWillBeSentReceivedTimestamp is set to zero and the pre request sweeper checks the interval timing, the expression likely always evaluates to true and removes the prerequest when the sweeper runs. The sweeper runs every 10 seconds, which could coincidentally run while the proxy spec is running in the middle of the rest of the system tests. This is why this is hard to reproduce while running a single system test, because most tests run faster than 10 seconds and the cypress server doesn't run for longer than 10 seconds. But with the full test suite going, the sweeper is going to run multiple times. To fix this, we need to check if cdpRequestWillBeSentReceivedTimestamp is set. If it isn't, we should just leverage the default sweeper logic.

Another issue I ran into when looking at this prerequest logic is that hashes are not accounted for in the proxied url in the middleware. When we push prerequests into the prerequest map, firefox bidi DOES contain hashes in the url (routes). To fix this, we remove the hash routes before pushing the url into the prerequest map.

Steps to test

How has the user experience changed?

PR Tasks

@AtofStryker AtofStryker force-pushed the chore/fix_proxy_spec_flake branch 3 times, most recently from 66b4c38 to a3e9a0e Compare June 16, 2025 18:28
@AtofStryker AtofStryker self-assigned this Jun 16, 2025
@AtofStryker AtofStryker force-pushed the chore/fix_proxy_spec_flake branch from a3e9a0e to e997ef6 Compare June 16, 2025 20:47
@AtofStryker AtofStryker changed the title chore (DRAFT): fix proxy spec flake in firefox fix: proxy spec flake in firefox due to improper sweeping and correlation Jun 16, 2025
…eivedTimestamp is set to 0. Also, do not ass hashes to prerequest url as the urls do not have hashes when coming through the middleware
@AtofStryker AtofStryker force-pushed the chore/fix_proxy_spec_flake branch from e997ef6 to 2d423d8 Compare June 16, 2025 20:51
Copy link

cypress bot commented Jun 17, 2025

cypress    Run #63093

Run Properties:  status check passed Passed #63093  •  git commit 2d423d8d26: fix: don't automatically remove requests when cdpRequestWillBeSentReceivedTimest...
Project cypress
Branch Review chore/fix_proxy_spec_flake
Run status status check passed Passed #63093
Run duration 18m 54s
Commit git commit 2d423d8d26: fix: don't automatically remove requests when cdpRequestWillBeSentReceivedTimest...
Committer Bill Glesias
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 73
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 5627
View all changes introduced in this branch ↗︎

Warning

No Report: Something went wrong and we could not generate a report for the Application Quality products.

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.

Firefox system-tests still flake after proxy correlation updates
1 participant