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

Noisy HTTP / XHR requests in Cypress logs #649

Closed
andymerskin opened this issue Dec 7, 2022 · 5 comments
Closed

Noisy HTTP / XHR requests in Cypress logs #649

andymerskin opened this issue Dec 7, 2022 · 5 comments

Comments

@andymerskin
Copy link

andymerskin commented Dec 7, 2022

Environment

  • cypress v10.9.0
  • cypress-io/github-action v4

Summary

I'm not sure which version this started happening in, but I noticed within the last 2-3 weeks that every HTTP request is being logged between it blocks, making it very hard to navigate Cypress CI logs in GH Actions summaries. This not only makes them super long, but difficult to pinpoint failures + reasons.

At a glance, I wasn't able to find any configuration options in Cypress or the action to keep the noise down. There is a related issue (cypress-io/cypress#7362) in the Cypress repo with similar complaints where there's too much HTTP noise in the command log, and unfortunately the only workarounds are janky and unofficial, causing important functionality like stubbing/interception to quit working properly, or needing to introduce super gross jQuery hackery to hide what could be put behind a configuration option.

Any help / suggestions would be appreciated!


Here's an example of what we're seeing, with no configuration changes since we started seeing this:

image

@kryshenp
Copy link

I might be wrong and just speculating but the issue could be somewhere outside the step that uses cypress-io/github-action.

I have 2 different workflows with a slightly different setups of the app but with completely identical uses: cypress-io/github-action@v5 cypress run step. In the output of one of them, I see the annoying noise that you're mentioning. The other one gives clear classic output.

@andymerskin
Copy link
Author

@kryshenp Huh, strange — I'm asking my team if they enabled any global verbose logging for HTTP requests or anything like that in our project. In your case, are these workflows in separate repos, or are there any other known differences like a different Linux image for the action, or different Cypress configs in each app?

@kryshenp
Copy link

kryshenp commented Dec 13, 2022

@docmars , all our workflows are in the same repo. I did some investigation and found in the workflow run history the exact workflow where this logging started to happen. I compared all logs and settings with a previous clear workflow run and didn't find any changes in workflow setups, installed packages, or config file - literally nothing. Ubuntu 20.04.5, Cypress 10.10.0, Electron 106 (headless), Node v16.13.0 in both cases.

I even restored both deleted branches and ran my workflow against them again, and in both runs, they produced these unwanted HTTP logs. The only conclusion I could have here is that GitHub implemented some new settings under the hood that are out of our control and visibility. The first time this issue occurred for us was on November 9th.

@andymerskin
Copy link
Author

andymerskin commented Dec 14, 2022

@kryshenp I found the culprit on my end — it's a real face-palmer too:

Vercel's serve package now defaults to logging all HTTP requests when it gets hit. We've been using this to serve our static build in the container.

They offer an option in 14.1.2 to suppress these logs by passing --no-request-logging, which has worked magically!

Closing this thread for now, but feel free to re-open if you suspect there is a different cause for your noisy logs. When in doubt, check your web server used in CI.

@MikeMcC399
Copy link
Collaborator

@docmars

Thanks for sharing!

I have an open PR here (#658) which also updates one of the examples to use serve 14.1.2. Now you point it out, I also notice the new log lines (see run 3679237962 => start => Cypress tests, Lines 58-60). Since the example test is very simple there weren't many additional logging lines displayed.

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

No branches or pull requests

3 participants