-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Retry failed RBE tests and get verbose logs #15456
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
Draft
titusfortner
wants to merge
8
commits into
trunk
Choose a base branch
from
log_debug
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+182
−40
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a4e5421
[build] make artifact upload handling more generic
titusfortner 8c7652b
[build] log rbe output to an artifact
titusfortner 5065c38
[build] update ruby bazel module to execute rake tasks with logs
titusfortner 963a10d
[build] implement jobs to retry rbe failures with extra debugging
titusfortner ee541c2
[build] only enable command tracing for rbe run in Debug mode
titusfortner 207ec23
[dotnet] toggle debug logs for tests based on environment variable DEBUG
titusfortner e782cb6
[py] enable selenium logging in tests if environment variable DEBUG i…
titusfortner d70a841
[java] support DEBUG environment variable for turning on logging of t…
titusfortner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,9 @@ | |
| import java.net.MalformedURLException; | ||
| import java.net.URL; | ||
| import java.time.Duration; | ||
| import java.util.Arrays; | ||
| import java.util.Optional; | ||
| import java.util.logging.Level; | ||
| import java.util.logging.Logger; | ||
| import org.junit.jupiter.api.AfterEach; | ||
| import org.junit.jupiter.api.BeforeAll; | ||
|
|
@@ -43,6 +45,20 @@ public abstract class JupiterTestBase { | |
|
|
||
| @RegisterExtension protected static SeleniumExtension seleniumExtension = new SeleniumExtension(); | ||
|
|
||
| static { | ||
| if ("true".equalsIgnoreCase(System.getenv("DEBUG"))) { | ||
| Logger rootLogger = Logger.getLogger(""); | ||
| rootLogger.setLevel(Level.FINE); | ||
| Arrays.stream(rootLogger.getHandlers()) | ||
| .forEach( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| handler -> { | ||
| handler.setLevel(Level.FINE); | ||
| }); | ||
|
|
||
| LOG.fine("Global debug logging enabled via DEBUG environment variable"); | ||
| } | ||
| } | ||
|
|
||
| protected TestEnvironment environment; | ||
| protected AppServer appServer; | ||
| protected Pages pages; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,31 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -eufo pipefail | ||
| # We want to see what's going on | ||
| set -x | ||
|
|
||
| # Now run the tests. The engflow build uses pinned browsers | ||
| # so this should be fine | ||
| # shellcheck disable=SC2046 | ||
| bazel test --config=remote-ci --build_tests_only \ | ||
| --keep_going --flaky_test_attempts=2 \ | ||
| //... -- $(cat .skipped-tests | tr '\n' ' ') | ||
|
|
||
| # Only enable command tracing if DEBUG is set | ||
| if [ -n "${DEBUG:-}" ]; then | ||
| set -x | ||
| fi | ||
|
|
||
| run_bazel_tests() { | ||
| # shellcheck disable=SC2046 | ||
| bazel test --config=remote-ci --build_tests_only \ | ||
| --keep_going --flaky_test_attempts=2 \ | ||
| //... -- $(cat .skipped-tests | tr '\n' ' ') | ||
| } | ||
|
|
||
| # Prepare log directory if BAZEL_LOG_FILE is set and run tests | ||
| if [ -n "${BAZEL_LOG_FILE:-}" ]; then | ||
| LOG_DIR=$(dirname "$BAZEL_LOG_FILE") | ||
| if mkdir -p "$LOG_DIR"; then | ||
| run_bazel_tests 2>&1 | tee "$BAZEL_LOG_FILE" | ||
| else | ||
| echo "Error: Failed to create directory for BAZEL_LOG_FILE" >&2 | ||
| exit 1 | ||
| fi | ||
| else | ||
| run_bazel_tests | ||
| fi | ||
|
|
||
| # Build the packages we want to ship to users | ||
| bazel build --config=remote-ci --build_tag_filters=release-artifact //... |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Tracelevel here by default:selenium/dotnet/test/common/AssemblyFixture.cs
Line 37 in 1cfa0a0
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.