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

Selfie JVM Snapshot Garbage Collection is overly zealous when using multiple test suites in gradle

Abierto
#574 2 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
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
java, kotlin

Línea de trabajo

Comienza con el reproductor enlazado y sus instrucciones del README; después, sigue la lógica de recolección de basura de snapshots de JUnit5 de Selfie para suites de pruebas de Gradle independientes. Reproduce la ejecución de integrationTest y verifica que los snapshots bajo src/test no se eliminen cuando esas pruebas no estén presentes en el classpath de integrationTest. Se considera terminado cuando los snapshots de pruebas unitarias no gestionados permanecen intactos y los snapshots obsoletos siguen gestionándose.

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

Descripción

bug jvm

In a project I was using a separate integrationTest source set with the JVM Test Suite approach recommended by Gradle link to instructions.

When done this way, the integration test sources will be in src/integrationTest instead of src/test. The classes in src/test will not be on the classpath of the integration tests.

When running Selfie with JUnit5, the current garbage collection logic is hardcoded to only look for *.ss files in src/test/ and performs a Class.forName(...)  to see if that test still exists and has tests that match the snapshot. If it doesn't find a match, it deletes the file. 

Since the unit tests are invisible on the integrationTest classpath, though, Class.forName(...) throws a ClassNotFoundException so selfie assumes this is a stale file and deletes. As a consequence, all the unit test snapshots are deleted when running the integrationTest task.

Is there some way to get the correct source root from Junit or something like that to avoid deleting unmanaged files?

A reproducer of the described issue can be found here with instructions in the README https://github.com/aelfric/selfie-bug-report-reproducer

Lenguaje dominante
Kotlin
Estrellas
101
Forks
18
Merge medio
6 d 11 h
PR fusionados (30 d)
5

Guía de contribución

Abrir la guía de contribución

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 diffplug/selfie

Todos los issues de diffplug/selfie

Issues similares

Más issues de Kotlin

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.