-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retry failed RBE tests and get verbose logs #15456
base: trunk
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Python configuration isn't quite right. You also need to add a logging handler, so I think it should look like:
if os.environ.get("DEBUG"):
logger = logging.getLogger("selenium")
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
I updated the docs with similar instructions recently:
https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/
Other than that, it looks fine. It might be interesting to make the log level configurable via environment variable (like LOG_LEVEL=DEBUG
or LOG_LEVEL=WARNING
), but it's understandable to just want a single DEBUG
flag that works across all languages.
|
||
if (!string.IsNullOrEmpty(enableDebugging)) | ||
{ | ||
Log.SetLevel(LogEventLevel.Debug); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already set to Trace
level here by default:
Internal.Logging.Log.SetLevel(Internal.Logging.LogEventLevel.Trace); |
Usually I see RBE logs directly in EngFlow:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. Why isn't it showing more output when the tests are passing?
In general the behavior I'm proposing is for the logging not to be turned on by default for faster execution / cleaner logs, and then allow the user to turn that on when needed (or automatically when failing). But it looks like current .NET is already not logging unnecessarily, so curious how you have it working.
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Logger rootLogger = Logger.getLogger(""); | ||
rootLogger.setLevel(Level.FINE); | ||
Arrays.stream(rootLogger.getHandlers()) | ||
.forEach( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is required since we are not registering any handlers but again having the code is not a problem. Looks fine to me.
User description
Motivation and Context
Chrome 134 introduced a bunch of weird errors to the RBE run that were not obvious and were not perfectly repeatable. They couldn't be reproduced outside of RBE. I needed to see verbose details to understand what the problem was, and I wanted to be able to compare what good and bad runs look like with that additional logging.
Description
retry_failed_tests
task that parses output of a bazel log to determine failed targets, and reruns each with log level set to debuggingDiscussion
Demo
This is what it looks like: https://github.com/SeleniumHQ/selenium/actions/runs/13935331133
There were RBE failures, the 3 failing targets were rerun on both RBE and on Github Actions runner
The logs are available as artifacts to download at the bottom of that page
You can see just how much larger the logs are of just those endpoints with the verbose logging
This is what it looks like with no RBE failures: https://github.com/SeleniumHQ/selenium/actions/runs/13939172170
Types of changes
PR Type
Enhancement, Tests
Description
Introduced environment-based debug logging across Java, .NET, and Python tests.
Enhanced Bazel build scripts and workflows for better logging and retry mechanisms.
Added support for retrying failed tests with detailed logs in CI workflows.
Improved artifact handling in GitHub Actions for better traceability.
Changes walkthrough 📝
7 files
Added DEBUG environment variable for Java logging
Enabled debug logging in .NET tests via environment variable
Added Debug property to TestEnvironment configuration
Enhanced Bazel execution to support logging to files
Enabled debug logging in Python tests via environment variable
Added Bazel log file handling and conditional debug tracing
Added task to retry failed tests from Bazel logs
3 files
Enhanced artifact handling and added Bazel log support
Added retry mechanisms for failed RBE and GHA tests
Updated artifact handling for pinned browsers