Skip to content

Conversation

@asolntsev
Copy link
Contributor

@asolntsev asolntsev commented Dec 5, 2025

User description

🔗 Related Issues

Fixes #16687

💥 What does this PR do?

Fixes the failing Chrome tests on Windows.

🔄 Types of changes

  • Bug fix (backwards compatible)

PR Type

Bug fix


Description

  • Reverts --enable-chrome-logs argument that caused test failures on Windows

  • Removes the problematic flag from ChromeDriver argument list

  • Updates test expectations to reflect removal of the flag


Diagram Walkthrough

flowchart LR
  A["ChromeDriver args generation"] -->|Remove --enable-chrome-logs| B["Fixed Windows test execution"]
  C["Test expectations"] -->|Update expected args| B
Loading

File Walkthrough

Relevant files
Bug fix
ChromeDriverService.java
Remove --enable-chrome-logs from ChromeDriver arguments   

java/src/org/openqa/selenium/chrome/ChromeDriverService.java

  • Removes --enable-chrome-logs argument from the createArgs() method
  • Adds blank line for code formatting consistency
  • Reverts the problematic flag that was causing Windows test failures
+1/-2     
Tests
ChromeDriverServiceTest.java
Update test expectations for removed flag                               

java/test/org/openqa/selenium/chrome/ChromeDriverServiceTest.java

  • Updates logLevelLastWins() test to remove --enable-chrome-logs from
    expected arguments
  • Updates ignoreFalseLogging() test to remove the flag from expected
    arguments
  • Adjusts four test assertion lists to match the reverted behavior
+5/-8     

@asolntsev asolntsev marked this pull request as draft December 5, 2025 16:19
@asolntsev asolntsev self-assigned this Dec 5, 2025
@selenium-ci selenium-ci added the B-build Includes scripting, bazel and CI integrations label Dec 5, 2025
@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
Limited Logging: The changes adjust artifact naming for test logs but do not introduce or ensure
comprehensive audit logging of critical actions; applicability to audit trails cannot be
confirmed from CI workflow changes alone.

Referred Code
- name: "Upload test logs"
  if: failure()
  uses: actions/upload-artifact@v5
  with:
    name: test-logs-${{ inputs.os }}-${{ inputs.name }}-${{ inputs.browser }}-${{ inputs.language }}
    retention-days: 7
    path: |
      **/*.log

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Failure Handling: The workflow uploads logs on failure but does not show additional error handling or
context enrichment for edge cases, which may be handled elsewhere in the pipeline.

Referred Code
if: failure()
uses: actions/upload-artifact@v5
with:
  name: test-logs-${{ inputs.os }}-${{ inputs.name }}-${{ inputs.browser }}-${{ inputs.language }}
  retention-days: 7
  path: |
    **/*.log

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status:
Log Exposure Risk: Uploading all *.log files as artifacts may expose internal details depending on log
contents; the diff does not show redaction or filtering controls.

Referred Code
with:
  name: test-logs-${{ inputs.os }}-${{ inputs.name }}-${{ inputs.browser }}-${{ inputs.language }}
  retention-days: 7
  path: |
    **/*.log

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status:
Unvetted Logs: The workflow uploads all log files without demonstrating redaction or structured logging
guarantees, which could include sensitive data depending on test output.

Referred Code
with:
  name: test-logs-${{ inputs.os }}-${{ inputs.name }}-${{ inputs.browser }}-${{ inputs.language }}
  retention-days: 7
  path: |
    **/*.log

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@asolntsev asolntsev changed the title Fix/16687 tests on windows Fix Chrome tests on windows Dec 5, 2025
@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Construct artifact name conditionally

Conditionally construct the artifact name using the format function to avoid
extra hyphens when optional inputs like browser or language are empty.

.github/workflows/bazel.yml [192]

-name: test-logs-${{ inputs.os }}-${{ inputs.name }}-${{ inputs.browser }}-${{ inputs.language }}
+name: ${{ format('test-logs-{0}-{1}{2}{3}', inputs.os, inputs.name, inputs.browser && format('-{0}', inputs.browser), inputs.language && format('-{0}', inputs.language)) }}
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: The suggestion correctly identifies that empty inputs can lead to malformed artifact names with extra hyphens and proposes a more robust conditional formatting approach to prevent this.

Low
  • More

…eams"

This reverts commit b2dc91f.

After adding `--enable-chrome-logs` argument, the tests started failing on Windows, e.g. `ChromeDriverFunctionalTest`. I don't know why.
@asolntsev asolntsev force-pushed the fix/16687-tests-on-windows branch from 15e1f5b to 65419ac Compare December 5, 2025 23:00
@asolntsev asolntsev requested review from Delta456 and diemol December 5, 2025 23:01
@asolntsev asolntsev marked this pull request as ready for review December 5, 2025 23:01
@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Learned
best practice
Document removed logging flag

Add a short comment explaining why --enable-chrome-logs was removed (e.g.,
Windows failures) and how logging is expected to work now to keep tests and
future changes consistent.

java/src/org/openqa/selenium/chrome/ChromeDriverService.java [296-318]

 // Readable timestamp and append logs only work if log path is specified in args
 // Cannot use logOutput because goog:loggingPrefs requires --log-path get sent
+// Note: --enable-chrome-logs intentionally not added due to Windows failures; rely on --log-path and --log-level for logging.
 if (getLogFile() != null) {
   args.add(String.format("--log-path=%s", getLogFile().getAbsolutePath()));
   if (Boolean.TRUE.equals(readableTimestamp)) {
     args.add("--readable-timestamp");
   }
 ...
   if (Boolean.TRUE.equals(disableBuildCheck)) {
     args.add("--disable-build-check");
   }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 6

__

Why:
Relevant best practice - Pattern 4: Avoid ad-hoc duplication and keep intent clear by documenting behavior changes that affect multiple call sites/tests.

Low
  • More

@asolntsev
Copy link
Contributor Author

asolntsev commented Dec 5, 2025

@Delta456 @diemol @cgoldberg (after many hours trying to install Bazel on Windows) I finally could reproduce the problem.
*ChromeDriverFunctionalTest stably fails on Windows with --enable-chrome-logs argument, and

  • stably works when I remove --enable-chrome-logs argument.

I don't know why, but this argument causes the Chrome failure.
Let's remove it for now, and we can investigate it later.

@asolntsev asolntsev merged commit cfd57e3 into SeleniumHQ:trunk Dec 6, 2025
37 of 38 checks passed
@asolntsev asolntsev deleted the fix/16687-tests-on-windows branch December 6, 2025 05:42
Copy link
Member

@Delta456 Delta456 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's investigate why it doesn't work on windows later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-build Includes scripting, bazel and CI integrations Review effort 1/5 Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: Unable to create a new chrome session with SNAPSHOT of 4.39.0

3 participants