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

Aperta
#17,834 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Jay4400 ci sta già lavorando.

Dal 10/8/2026.

  • #17832 di @MohabMohie — chiusa senza merge

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
java
Ambito
tooling

Direzione di ricerca

Inizia con #17832, in particolare con le relative Additional Considerations e Implementation Notes, quindi traccia l’inizializzazione di RemoteWebDriver attraverso ChromeDriver/FirefoxDriver, DriverFinder, Selenium Manager e Debug.configureLogger(). Valuta gli approcci elencati usando un secondo driver il cui interruttore di debug cambia durante l’esecuzione. Il lavoro è completato quando il comportamento per quel caso è stato corretto e verificato oppure documentato come limitazione accettata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).

Lingua principale
Java
Stelle
34.6k
Fork
8.7k
Merge medio
1g 23h
PR unite (30g)
86

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SeleniumHQ/selenium

Tutte le issue di SeleniumHQ/selenium

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.