[🐛 Bug]: Second driver's discovery logging still misses a debug switch flipped mid-run

未关闭
#17,834 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Jay4400 已经在做这个了。

开始于 2026年8月10日。

  • #17832 来自 @MohabMohie —— 已关闭,未合并

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
冷清
技术栈
java
领域
tooling

调研方向

从 #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)
  1. Move (or duplicate) the Debug.configureLogger() call earlier, into DriverFinder/Selenium Manager's own discovery-logging call sites directly, so it no longer depends on being reached via any particular constructor's control flow.
  2. Give ChromeDriver/FirefoxDriver a 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 calls Debug.configureLogger() — need to verify this actually resolves the second-driver case and not just duplicate the same first-instance limitation at a different class.
  3. 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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

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

SeleniumHQ/selenium 的其他 Issue

查看 SeleniumHQ/selenium 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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