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

Improving the memory leak test that fails randomly in CI.

Abierto
#971 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
testing

Línea de trabajo

Start with find_memleak in comtypes.test.test_comserver and read how the test measures Working Set across repeated process runs. Separate ordinary COM behavior checks from memory checks, then investigate ownership and release at the COM boundary for BSTR, VARIANT, and SAFEARRAY. Done means normal CI has fewer memory-related random failures while the test can detect actual leaks in those types.

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

Descripción

ci tests

Problems

find_memleak in comtypes.test.test_comserver fails randomly in the CI environment.

  • The current test checks the difference in the Working Set before and after running the process many times.
  • An increase in the Working Set does not always mean an actual memory leak.
  • On the other hand, even if the Working Set does not grow, we cannot always find a leak.
  • In Local Server tests, measuring memory on the client side cannot directly find leaks on the COM server side running in another process.

Because of this, the test not only fails randomly, but we might also miss real memory leaks.

Technical Solution Candidates: Detect Actual Memory Leaks

  1. Separate feature tests from memory checks
  • Verify COM return values and types in normal feature tests.
  • Rethink judgments based only on the difference in the Working Set.
  1. Directly check the release rules
  • Check the transfer of ownership and the matching release process for BSTR, VARIANT, and SAFEARRAY.
  • Check not only calls like VariantClear, but also resource management at the actual COM boundary.
  1. Look into native memory leaks separately
  • Check memory managed by Python using tools like tracemalloc from the Python standard library.
  • If needed, measure both the client and COM server processes, and check for native memory leaks using Windows diagnostic tools.

Completion Condition

Set up a test that reduces random failures caused by memory usage changes in normal CI, while being able to detect actual memory leaks in BSTR, VARIANT, and SAFEARRAY.

Lenguaje dominante
Python
Estrellas
347
Forks
107
Merge medio
1 d 5 h
PR fusionados (30 d)
19

Preparar el entorno

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 enthought/comtypes

Todos los issues de enthought/comtypes

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.