Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Improving the memory leak test that fails randomly in CI.

Aperta
#971 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
testing

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
347
Fork
107
Merge medio
1g 5h
PR unite (30g)
19

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di enthought/comtypes

Tutte le issue di enthought/comtypes

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.