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.

Improve error message in the case if cannot fetch data from the response data stream

See original GitHub issue

What is your Test Scenario?

I’m running a long set of tests over resource heavy website

What is the Current behavior?

At some point tests crash with an error

/home/runner/work/xxx/node_modules/testcafe/node_modules/testcafe-hammerhead/lib/request-pipeline/connection-reset-guard.js:21
  throw err;
  ^

RangeError [ERR_INVALID_OPT_VALUE]: The value "7662819937" is invalid for option "size"
    at Function.allocUnsafe (buffer.js:382:3)
    at Function.concat (buffer.js:563:25)
    at IncomingMessage.<anonymous> (/home/runner/work/xxx/node_modules/testcafe/node_modules/testcafe-hammerhead/lib/utils/promisify-stream.js:10:38)
    at IncomingMessage.emit (events.js:326:22)
    at IncomingMessage.EventEmitter.emit (domain.js:548:15)
    at endReadableNT (_stream_readable.js:1252:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  code: 'ERR_INVALID_OPT_VALUE',
  domainThrown: true
}
Thrown at:
    at addCodeToName (internal/errors.js:301:11)
    at NodeError (internal/errors.js:268:7)
    at buffer.js:360:11
    at hidden (internal/errors.js:288:14)
    at allocUnsafe (buffer.js:382:3)
    at concat (buffer.js:563:25)
    at /home/runner/work/xxx/node_modules/testcafe/node_modules/testcafe-hammerhead/lib/utils/promisify-stream.js:10:38
    at emit (events.js:326:22)
    at EventEmitter.emit (domain.js:548:15)
    at endReadableNT (_stream_readable.js:1252:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 7

The issue is not bound to a specific test as far as I can see

What is the Expected behavior?

Best case scenario would be to find a fix, but I’d at least expect that tests can continue execution even if an error happens.

What is your web application and your TestCafe test code?

Can’t share 😦

Steps to Reproduce:

I couldn’t isolate steps to reproduce other than just running my large test suite

Your Environment details:

  • testcafe version: 1.8.8
  • node.js version: 14.10.1
  • browser name and version: Chrome
  • platform and version: macOS 10.15.6

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
miherlosevcommented, Sep 23, 2020

Yes, it’s a good idea. We can improve the error message. For example, it will look like this:

Cannot fetch data for the <url> resource due to the error:
Original error message:
Original error stack:
0reactions
github-actions[bot]commented, Oct 31, 2021

We’re closing this issue after a prolonged period of inactivity. If it still affects you, please add a comment to this issue with up-to-date information. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript fetch - Failed to execute 'json' on 'Response'
In my case, the error was being thrown because first I was trying to consume the response data as a JSON, then consuming...
Read more >
Question — Why can I not read the stream again ? · Issue #196
Once I have done fetch('/url').then(x => x.json()) If I do call the json() again, why does it have to throw — TypeError Already...
Read more >
Error Handling for Network Requests in Client-Side JavaScript ...
As we can see, we've fixed the SyntaxError that our fetch function ran into when were accessing this endpoint, and we are now...
Read more >
Handling Failed HTTP Responses With fetch() - TJ VanToll
Per MDN, the fetch() API only rejects a promise when a “network error is encountered, although this usually means permissions issues or similar....
Read more >
Streaming requests with the fetch API - Chrome Developers
Gradually send data generated on the client, such as audio, ... Maybe you can think of a much more exciting use-case for request...
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