Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

testdouble experiencing memory issue when running 800 unit tests

Abierto
#534 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
javascript, nodejs
Área
testing

Línea de trabajo

Start by reproducing the memory growth with the reported 800-test Jenkins scenario using testdouble 3.20.2, then inspect the regression/src directory for a focused failing test. Run npm it after adding a minimal reproduction; done means the retained testdouble usage is reproducible and the cleanup behavior is covered by a regression test.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
JavaScript
Estrellas
1.4k
Forks
140
Merge medio
7 h 51 min
PR fusionados (30 d)
3

Preparar el entorno

Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de testdouble/testdouble.js

Todos los issues de testdouble/testdouble.js

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.