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

testdouble experiencing memory issue when running 800 unit tests #534

Open
13 tasks
Shira-f opened this issue Aug 29, 2024 · 0 comments
Open
13 tasks

testdouble experiencing memory issue when running 800 unit tests #534

Shira-f opened this issue Aug 29, 2024 · 0 comments

Comments

@Shira-f
Copy link

Shira-f commented Aug 29, 2024

Description

Running 800 unit tests using testdouble, resulting in memory leak.

Issue

There are many testdouble usages that do not seem to be deleting properly. Therefore, when building on Jenkins, it terminates with the error message:
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

This image comes from a Heap Snapshot of some of the tests.

Screenshot 2024-08-29 at 3 34 13 PM

Our currently code consists of the following, but it doesn't seem to help resolve the memory leak.
afterEach(function () { td.reset(); });

Are there any other lines that should be included to help with garbage collection?

Environment

  • node -v output: 18.20.4
  • npm -v (or yarn --version) output: 10.7.0
  • npm ls testdouble (or yarn list testdouble) version: 3.20.2

Failing Test

  • Fork the repo
  • Add a failing test (probably to the `/regression/src' directory)
  • Submit a pull request for the failing test or link to your branch here

Example Repo

  • Create a minimal repository that reproduces the issue
  • Make sure that a fresh clone can run only npm it and observe the issue
  • Link to that repo here

Runkit Notebook

  • Create a Runkit notebook
  • Invoke var td = require('testdouble') at the top
  • Verify the behavior your issue is concerned with by clicking "Run"
  • Link to the Runkit here

Code-fenced Examples

var td = require('testdouble')

// Your steps here.
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

1 participant