Skip to content

[internal] Firefox test page/page-evaluate.spec.ts - should throw for too deep reference chain is failing #35842

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

Closed
mxschmitt opened this issue May 3, 2025 · 3 comments · Fixed by #35931
Assignees
Labels

Comments

@mxschmitt
Copy link
Member

mxschmitt commented May 3, 2025

Failing since 6d3ee50

Looks like Chrome limit is 1000.

Looks like this isUnderTest call is making the difference which has an effect on this. These together probably cause the object to be larger and then cause the Maximum call stack size exceeded message to appear.

@mxschmitt mxschmitt changed the title [internal] Firefox test is failing [internal] Firefox test page/page-evaluate.spec.ts - should throw for too deep reference chain is failing May 3, 2025
@mxschmitt mxschmitt added the v1.53 label May 3, 2025
@dgozman
Copy link
Contributor

dgozman commented May 4, 2025

Failing since 6d3ee50

This is incorrect, this test is flaky for a loooong time.

@mxschmitt
Copy link
Member Author

mxschmitt commented May 5, 2025

Interesting! I'm still wondering why this makes a difference on my machine.

@mxschmitt
Copy link
Member Author

Debugging notes:

There are two limits which play a role here:

  1. JSON.stringify max recursion limit
  2. browser -> Playwright serialiser max serialiser depth.

Lets look at 1. for now. This can be determined e.g. using the following which is the same as what we have in our tests:

(() => {
    const depth = 2811;
      const obj = {};
    let temp = obj;
    for (let i = 0; i < depth; i++) {
      temp[i] = {};
      temp = temp[i];
    }
    JSON.stringify(obj)
})()

These two browsers have the following two values

Chrome limit: 2810
Firefox limit: 3024

As we can see, these values are pretty similar. Lets look at 2. next:

Chromium has a protocol max depth of 1000. This is the error we receive in Playwright and assert to. In Firefox there doesn't seem like such a limit.

We hit this limit in Firefox and it throws here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants