question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Noisy HTTP / XHR requests in Cypress logs

See original GitHub issue

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 (https://github.com/cypress-io/cypress/issues/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

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
docmarscommented, 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.

0reactions
MikeMcC399commented, Dec 14, 2022

@docmars

Thanks for sharing!

I have an open PR here (https://github.com/cypress-io/github-action/pull/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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Muting Noisy XHR Logs in Cypress - DEV Community ‍ ‍
This solution uses CSS to prevent the XHR requests from being picked up in the DOM and thereby reported to the Cypress runner....
Read more >
Hide XHR requests from the command log #7362 - GitHub
Current behavior: All XHR requests are printed to the command log, which can be distracting. ... Noisy HTTP / XHR requests in Cypress...
Read more >
How to hide XHR in Cypress - YouTube
How to hide XHR in Cypress ; Muting Noisy XHR Logs in CypressLink to full article: ...
Read more >
Hide XHR calls on Cypress test runner - Stack Overflow
I am trying to hide XHR calls on cypress test runner. I have added the below code in my support/index.js but it still...
Read more >
Changelog - Cypress Documentation
Reduced the occurrence of an issue where logs for fetch and xhr requests could be ... For example, if the application under test...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found