Tracing temp directories are never cleaned up when keywords are called from Python outside a Robot Framework run
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- playwright, python
- 领域
- testing-qa
调研方向
从 Browser/keywords/playwright_state.py 第 911 行附近开始,跟踪 close_context() 直到其 trace flush。将这条路径与 Browser/browser.py:838-848 中的 cleanup 进行比较,后者只会从 _start_suite listener hook 运行。复现仅使用 Python 的示例,并确认关闭一个启用了 tracing 的 context 不会在 browser/traces/temp// 下留下目录。
由索引模型根据 Issue 内容生成。
描述
Tracing writes its working files to browser/traces/temp/<uuid>/ (Browser/keywords/playwright_state.py:911). Those are cleaned up from the _start_suite listener hook (Browser/browser.py:838-848), which only fires during a Robot Framework run. When keywords are called directly from Python the hook never runs, so the temp directories accumulate and are never removed.
Reproduce
from Browser import Browser
browser = Browser()
browser.new_browser("webkit", headless=True)
browser.new_context(tracing=True)
browser.new_page("https://robotframework-browser.org")
browser.close_context()
browser.close_browser("ALL")
Observed afterwards, left in place:
browser/traces/temp/<uuid>/
<name>.trace
<name>.network
resources/*.jpeg
The trace zip itself is produced correctly by close_context(); it is only the temp working directory that is left behind, once per traced context.
Note that with the default outputdir these land inside the installed package rather than the caller's working directory — that part is a separate issue about the relative default outputdir, and it is filed on its own. This report is about the cleanup never happening at all, which remains true even when outputdir is absolute.
Suggested fix
Remove the temp directory when the trace is flushed in close_context(), rather than relying on a listener hook that only exists during a Robot Framework run.
Environment
Browser 20.3.0, Robot Framework 7.4.1, Python 3.14.7, macOS, webkit.
- 主要语言
- Python
- 星标
- 662
- 派生
- 149
- 平均合并
- 6 小时 13 分钟
- 30 天内合并 PR
- 121
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MarketSquare/robotframework-browser 的其他 Issue
-
priority: high
难度 2/5 1-3 小时 新手友好度 75/100
MarketSquare/robotframework-browser#5306 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
MarketSquare/robotframework-browser#5503 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 78/100
MarketSquare/robotframework-browser#5502 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 54/100
MarketSquare/robotframework-browser#5501 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 76/100
MarketSquare/robotframework-browser#5500 ·
维护者通常 1 天内回复
查看 MarketSquare/robotframework-browser 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
igormcsouza/tether#278 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 91/100
aws-samples/sample-per-model-bedrock#803 ·
维护者通常 1 天内回复
-
documentation p1
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
huggingface/accelerate#4511 ·
维护者通常 1 天内回复
-
follow-up
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复