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

Đang mở
#17,834 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Jay4400 đang làm issue này rồi.

Từ ngày 10/8/2026.

  • #17832 của @MohabMohie — đã đóng, không merge

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
java
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu với #17832, đặc biệt là Additional Considerations và Implementation Notes của issue này, sau đó lần theo quá trình khởi tạo RemoteWebDriver qua ChromeDriver/FirefoxDriver, DriverFinder, Selenium Manager và Debug.configureLogger(). Đánh giá các cách tiếp cận được liệt kê với một driver thứ hai có công tắc debug thay đổi trong khi chạy. Công việc được xem là hoàn tất khi hành vi trong trường hợp đó либо đã được sửa và xác minh, либо được ghi lại như một giới hạn được chấp nhận.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Java
Star
34.6k
Fork
8.7k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
86

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của SeleniumHQ/selenium

Tất cả issue của SeleniumHQ/selenium

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.