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.

ClientFunction not working for returning large object/array

See original GitHub issue

Are you requesting a feature or reporting a bug?

Bug

What is the current behavior?

TestCafe keeps waiting at ClientFunction when returning object/array which is very large for following code.

const getFirstGridTotalRows = ClientFunction(() => {
    return window.gridRef[0].filteredRows();
});
const gridData = await getFirstGridTotalRows();

gridData is expected to have around 99k objects in an array. But while running tests, tests are not going forward. It is not even throwing any error. it just waits.

What is the expected behavior?

Should either throw error of memory limit or return the data.

How would you reproduce the current behavior (if this is a bug)?

Take any very large dataset and return it from application url through ClientFunction.

Provide the test code and the tested page URL (if applicable)

Tested page URL:

Test code

const getFirstGridTotalRows = ClientFunction(() => {
    return window.gridRef[0].filteredRows();
});
const gridData = await getFirstGridTotalRows();

Specify your

  • operating system: Windows 7
  • testcafe version: 0.11.1
  • node.js version: 6.9.1

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
inikulincommented, Jan 10, 2017

I was able to reproduce the issue. The cause of the problem is that browser runs out of memory when we try to serialize enormously large object. I guess the best option here will be a limit for the returned object size, let’s just throw an error with some descriptive message.

0reactions
lock[bot]commented, Mar 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ClientFunction: _axios2 is not defined - Stack Overflow
I'm running TestCafe for UI automation, using ClientFunctions to trigger API requests (so that I can pass along session cookies).
Read more >
ClientFunction Object | Test API | API | Docs - TestCafe
A client function that can return any serializable value from the client side. Use the ClientFunction constructor to create a client function.
Read more >
ES5 to ESNext — here's every feature added to JavaScript ...
fullName() will not work, and will return the string "undefined ... Just like any value (object, array, string, number) can be used as...
Read more >
HandCrank: Hybrid Partial Evaluation for JavaScript
This problem can be solved with the help of partial evaluation. A partial evaluator can combine a program written in a DSL with...
Read more >
Index of the Clojure API
A. *agent* var clojure The agent currently running an action on this thre... *alias-map* dynamic var tools.reader Map from ns alias to ns,...
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