[🐛 Bug]: Second driver's discovery logging still misses a debug switch flipped mid-run
维护者通常 1 天内回复
评估
调研方向
从 #17832 开始,尤其关注其中的 Additional Considerations 和 Implementation Notes,然后跟踪 RemoteWebDriver 通过 ChromeDriver/FirefoxDriver、DriverFinder、Selenium Manager 和 Debug.configureLogger() 进行初始化的过程。针对第二个 driver(其 debug 开关会在运行期间发生变化)评估列出的方案。对于该情况,行为要么已得到修正并验证,要么已记录为可接受的限制,才算完成。
由索引模型根据 Issue 内容生成。
描述
Feature and motivation
Follow-up from #17832 (part of the umbrella tracker, see linked issue).
RemoteWebDriver's static initializer (JLS 12.4.2) is guaranteed to run once, before any subclass constructor body — including argument expressions passed to a subclass's own super(...) call, which is where ChromeDriver/FirefoxDriver perform DriverFinder/Selenium Manager discovery logging. #17832 uses that static initializer to make the first driver constructed in a JVM correctly pick up the debug switch for its own discovery logging.
That only covers the first driver. For a second (or later) driver, if the debug switch is flipped between the first and second construction, that second driver's own discovery logging still runs — via its super(...) argument evaluation — before Debug.configureLogger() is reached inside the instance constructor body. Its discovery logging is still missed.
This is not a regression: the gap has always existed on trunk. #17832 narrows it (first-driver case now works) but explicitly does not close it, and flags it as a maintainer call in its "Additional Considerations" section.
Options (not evaluated in depth yet — for whoever picks this up)
- Move (or duplicate) the
Debug.configureLogger()call earlier, intoDriverFinder/Selenium Manager's own discovery-logging call sites directly, so it no longer depends on being reached via any particular constructor's control flow. - Give
ChromeDriver/FirefoxDrivera static initializer of their own (JLS 12.4.2 runs a subclass's static initializer before any instance of it is constructed, but after the superclass's static initializer already ran) that callsDebug.configureLogger()— need to verify this actually resolves the second-driver case and not just duplicate the same first-instance limitation at a different class. - Accept the gap as a known limitation of static-initializer-timing and document it rather than fix it, if no clean fix exists that doesn't complicate driver subclass initialization further.
Related
#12892, #17832 (see its "Additional Considerations" and Implementation Notes items 1–2 for the original writeup of this gap).
- 主要语言
- Java
- 星标
- 34.6k
- 派生
- 8.7k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 86
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SeleniumHQ/selenium 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
SeleniumHQ/selenium#18323 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
SeleniumHQ/selenium#17843 · 2 条评论 ·
维护者通常 1 天内回复
-
[java] DriverFinderTest property fixture doesn't clear/restore selenium.webdriver.verbose可能重新可做 @stefanpoia 于 25 天前认领,目前没有进行中的 PR。 未关闭
难度 1/5 1-3 小时 新手友好度 88/100
SeleniumHQ/selenium#17836 · 3 条评论 ·
维护者通常 1 天内回复
-
A-needs-triaging C-java D-chrome D-firefox I-defect OS-linux
难度 4/5 1-2 天 新手友好度 53/100
SeleniumHQ/selenium#18324 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug]: [py] Generated bidi.UserAgentClientHints is empty — inline CDDL params drop the command可能已有人在做 @titusfortner 于 3 天前认领。 未关闭C-py OS-mac
SeleniumHQ/selenium#18312 · 已指派 2 人 ·
维护者通常 1 天内回复
查看 SeleniumHQ/selenium 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
jenkinsci/git-client-plugin#1807 ·
-
area-templates triage:bot-seen triage:needs-human
难度 2/5 1-3 小时 新手友好度 75/100
microsoft/aspire#22356 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 84/100
apache/flink-agents#1395 ·
维护者通常 1 天内回复