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

オープン
#17,834 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Jay4400 がすでに取り組んでいます。

2026年8月10日 から。

  • #17832 @MohabMohie による — マージされずにクローズ

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
java
領域
tooling

調査の方向性

#17832、特にその Additional Considerations と Implementation Notes から始め、ChromeDriver/FirefoxDriver、DriverFinder、Selenium Manager、Debug.configureLogger() を経由する RemoteWebDriver の初期化を追跡します。一覧にあるアプローチを、実行中にデバッグスイッチが変わる 2 つ目の driver に対して評価します。そのケースの動作が修正されて検証されるか、受け入れられた制限として文書化されれば完了です。

索引モデルが 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時間
マージ済み PR(30日)
86

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SeleniumHQ/selenium のほかの issue

SeleniumHQ/selenium の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。