Skip to content
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

Unintentional POST /add-verified-command request during e2e tests execution #27245

Closed
edwardzikthegreat opened this issue Jul 10, 2023 · 6 comments
Assignees
Labels
stale no activity on this issue for a long period

Comments

@edwardzikthegreat
Copy link

Current behavior

After updating Cypress from v10 to v12.17.0 I started to get hundreds of POST .../__cypress/add-verified-command requests with some args, key, name on url in payload... I noticed huge performance drop during tests execution (cypress open mode) - probably because of it.

Issue occur for Chrome and Firefox browser family.

image

image

image

image

Desired behavior

  • POST add-verified-command shouldn't be visible in Network
  • it shouldn't have any impact for tests execution performance
  • it should be possible to turn it off
  • if it's needed proper justification should be presented

Test code to reproduce

Due to the project specification I cannot share my code.

Project dependencies relevant for this issue:

  • "react": "^18.2.0",
  • "vite": "4.3.9",
  • "@cypress/vite-dev-server": "^5.0.5",
  • "@badeball/cypress-cucumber-preprocessor": "^18.0.1",
  • "@bahmutov/cypress-esbuild-preprocessor": "^2.2.0"

Cypress Version

12.17.0

Node version

18.16.1

Operating System

Windows 10 PRO

Debug Logs

2023-07-10T10:58:54.748Z cypress:server:socket-base automation:request clear:cookies []
2023-07-10T10:58:54.748Z cypress:server:automation:cookies clear:cookies 0
2023-07-10T10:58:54.751Z cypress:server:socket-base backend:request { eventName: 'reset:rendered:html:origins', args: [] }
2023-07-10T10:58:54.764Z cypress:server:browsers:chrome add X-Cypress-Is-XHR-Or-Fetch header to: http://localhost:3003/__cypress/add-verified-command
2023-07-10T10:58:54.764Z cypress:server:browsers:chrome continueRequest: { requestId: 'interception-job-20.0', headers: [ { name: 'Accept', value: '*/*' }, { name: 'Content-Type', value: 'application/json' }, { name: 'Cookie', value: '__cypress.initial=true' }, { name: 'Referer', value: 'http://localhost:3003/__cypress/iframes/cypress%5Ce2e%5Cfeatures%5Clocal%5Cgeneral%5CXXXXXXXXXXXX.feature?browserFamily=chromium' }, { name: 'User-Agent', value: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' }, { name: 'sec-ch-ua', value: '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"' }, { name: 'sec-ch-ua-mobile', value: '?0' }, { name: 'sec-ch-ua-platform', value: '"Windows"' }, { name: 'X-Cypress-Is-XHR-Or-Fetch', value: 'xhr' } ] }
2023-07-10T10:58:54.810Z cypress:server:socket-base backend:request { eventName: 'run:privileged', args: [ { commandName: 'task', options: [Object], userArgs: [Array] } ] }
2023-07-10T10:58:54.811Z cypress:server:task run task cypress-cucumber-preprocessor:spec-envelopes with arg {
  messages: [
    { source: [Object] },
    { gherkinDocument: [Object] },
    { pickle: [Object] },
    { pickle: [Object] },
    { pickle: [Object] },
    { pickle: [Object] },
    { pickle: [Object] },
    { pickle: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { hook: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    { stepDefinition: [Object] },
    ... 760 more items
  ]
}
2023-07-10T10:58:54.813Z cypress:lifecycle:EventRegistrar plugin event registered? { eventName: 'task', isRegistered: true }
2023-07-10T10:58:54.813Z cypress:lifecycle:EventRegistrar execute plugin event 'task' Node 'v16.16.0' with args: 'cypress-cucumber-preprocessor:spec-envelopes' { messages: [ { source: [Object] }, { gherkinDocument: [Object] }, { pickle: [Object] }, { pickle: [Object] }, { pickle: [Object] }, { pickle: [Object] }, { pickle: [Object] }, { pickle: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { hook: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, { stepDefinition: [Object] }, ... 760 more items ] } undefined
2023-07-10T10:58:54.813Z cypress:lifecycle:ProjectConfigManager call event task for invocation id inv7
2023-07-10T10:58:54.819Z cypress:lifecycle:child:RunPlugins:15704 execute plugin event: task ({ invocationId: 'inv7', eventId: 9 })
2023-07-10T10:58:54.820Z cypress:lifecycle:ProjectConfigManager promise resolved for id 'inv7' with value true
2023-07-10T10:58:54.821Z cypress:server:task result is: true

Other

No response

@edwardzikthegreat
Copy link
Author

@cacieprins any news? I just updated to Cypress 13 and issue still occurs :(

@DlgSHi
Copy link

DlgSHi commented Oct 24, 2023

@nagash77 , @cacieprins Hello, how can we able to force this? It is quite annoying to see thousands of those requests. King Regards :)

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Apr 22, 2024
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
@cacieprins
Copy link
Contributor

cacieprins commented May 17, 2024

@DlgSHi @edwardzikthegreat I'm so sorry that this fell through the cracks -

I'm not extremely familiar with this section of the codebase, but it looks like when invoking certain commands (exec, origin, readFile, selectFile, writeFile and ask) that must be executed on the host operating system (rather than in the browser), we do some extra verification. This involves registering each command with the Cypress host server (e.g., ./packages/server) before it is executed, so we can ensure it's being executed only from the spec that registered it.

If this is causing performance issues for you, you might try to combine several commands into a task, execute fewer of them, reducing the size of the arguments sent to these commands, or decreasing the number of tests in each spec.

I understand that it can be difficult to provide a reproduction case when an issue is encountered in proprietary code, but if you can create a reproduction of this issue in a fork of https://github.com/cypress-io/cypress-example-kitchensink/ or https://github.com/cypress-io/cypress-realworld-app, we can investigate further whether this is a bug, or if this is Cypress working as intended. I'm leaving this issue closed, for now - if a reproduction can be provided, please open a new issue.

Thank you!

@DlgSHi
Copy link

DlgSHi commented Jun 11, 2024

@cacieprins hi :) no worries, seems it doesn't occur in v.13.11 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity on this issue for a long period
Projects
None yet
Development

No branches or pull requests

4 participants