Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Improving the memory leak test that fails randomly in CI.

未关闭
#971 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
testing

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
346
派生
107
平均合并
1 天 1 小时
30 天内合并 PR
23

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

enthought/comtypes 的其他 Issue

查看 enthought/comtypes 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。