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

Yet another Maximum call stack size exceeded error (with Expect.equalLists) #123

Open
Steve-OH opened this issue Feb 16, 2020 · 2 comments

Comments

@Steve-OH
Copy link

Steve-OH commented Feb 16, 2020

I'm sporadically getting the dreaded RangeError: Maximum call stack size exceeded with Expect.equalLists. Because the occurrence of the error seems to be very sensitive to factors that I don't fully understand, I've put the relevant files for reproduction (all three of them) into a repository at https://github.com/Steve-OH/elm-test-crash.

What's happening: The test fuzzer creates lists of integers that are 99% 1s and 1% 2s. (The ratio is not important; it's just there to make the failure conditions more apparent.) The only "test" (such as it is) in the suite compares the original list to a list that has all of the 2s stripped out, using Expect.equalLists. Thus, the test should pass if the original list consists only of 1s, and fail if the original list contains any 2s. The test does pass in the first case, but rather than failing in the second, it crashes with RangeError: Maximum call stack size exceeded.

The crash seems to be dependent on factors that you wouldn't expect to be relevant, such as whether the Elm code is in a package (crashes reliably) or in an application (I could not get it to crash that way).

Reported info:

OS: Windows 10.0.18362.0 (version 1903 build 18362.657)
elm --version: 0.19.1
elm-test --version: 0.19.1-revision2
node --version: v12.13.1

@mpizenberg
Copy link
Contributor

mpizenberg commented Sep 30, 2021

Hi @Steve-OH, I came here from your link in the discord post.

I've just run the tests of your elm-test-crash repo and I can't get a crash, so maybe this bug was solved? I run it with elm-explorations/test at version 1.2.2

Could you confirm if it's working for you too? I'd suggest removing elm-stuff/ to make sure elm-test uses the latest version of elm-explorations/test.

@mpizenberg
Copy link
Contributor

In particular, it seems I can consistently trigger the call stack crash with version 1.0.0 of elm-explorations/test but not crash anymore starting with version 1.1.0. So if that was the issue, I'd suggest using the following lower bound in your tests dependencies:

    "test-dependencies": {
        "elm-explorations/test": "1.2.2 <= v < 2.0.0"
    }

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

2 participants