Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: tools/testing/dart/test_runner.dart

Issue 2081173002: Add suppression to test.dart for flaky content_shell crashes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/testing/dart/test_runner.dart
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 3f755dda9cf4109fa282b869ab3ce63d73041aac..ebe5b0104e81b9376cb3f924d2e1ff570517ee7d 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -1054,26 +1054,50 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
// See: http://dartbug.com/15139.
static int WHITELISTED_CONTENTSHELL_EXITCODE = -1073740022;
static bool isWindows = io.Platform.operatingSystem == 'windows';
+ static bool _failedBecauseOfFlakyInfrastructure(List<int> stderr) {
+ // If the browser test failed, it may have been because content shell
+ // and the virtual framebuffer X server didn't hook up, or it crashed with
+ // a core dump. Sometimes content shell crashes after it has set the stdout
+ // to PASS, so we have to do this check first.
+ // Content shell also fails with a broken pipe message: Issue 26739
+ var zygoteCrash = new RegExp(
+ r"ERROR:zygote_linux\.cc\(\d+\)] write: Broken pipe");
+ var stderrLines = decodeUtf8(stderr).split("\n");
+ for (String line in stderrLines) {
kustermann 2016/06/21 14:22:19 I think you can avoid the split into lines & itera
Bill Hesse 2016/06/24 12:06:59 Done.
+ // TODO(whesse): Issue: 7564
+ // This may not be happening anymore. Test by removing this suppression.
+ if (line.contains(MESSAGE_CANNOT_OPEN_DISPLAY) ||
+ line.contains(MESSAGE_FAILED_TO_RUN_COMMAND)) {
+ DebugLogger.warning(
+ "Warning: Failure because of missing XDisplay. Test ignored");
+ return true;
+ }
+ // Issue 26739
+ if (zygoteCrash.hasMatch(line)) {
+ DebugLogger.warning("Warning: Failure because of content_shell "
+ "zygote crash. Test ignored");
+ return true;
+ }
+ }
+ return false;
+ }
- bool _failedBecauseOfMissingXDisplay;
+ bool _infraFailure;
BrowserCommandOutputImpl(
command, exitCode, timedOut, stdout, stderr, time, compilationSkipped)
: super(command, exitCode, timedOut, stdout, stderr, time,
- compilationSkipped, 0) {
- _failedBecauseOfMissingXDisplay = _didFailBecauseOfMissingXDisplay();
- if (_failedBecauseOfMissingXDisplay) {
- DebugLogger.warning("Warning: Test failure because of missing XDisplay");
- // If we get the X server error, or DRT crashes with a core dump, retry
- // the test.
- }
- }
+ compilationSkipped, 0),
+ _infraFailure = _failedBecauseOfFlakyInfrastructure(stderr);
Expectation result(TestCase testCase) {
// Handle crashes and timeouts first
if (hasCrashed) return Expectation.CRASH;
if (hasTimedOut) return Expectation.TIMEOUT;
+ if (_infraFailure) {
+ return Expectation.IGNORE;
+ }
var outcome = _getOutcome();
if (testCase.hasRuntimeError) {
@@ -1091,8 +1115,8 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
bool get successful => canRunDependendCommands;
bool get canRunDependendCommands {
- // We cannot rely on the exit code of content_shell as a method to determine
- // if we were successful or not.
+ // We cannot rely on the exit code of content_shell as a method to
+ // determine if we were successful or not.
return super.canRunDependendCommands && !didFail(null);
}
@@ -1101,34 +1125,12 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
}
Expectation _getOutcome() {
- if (_failedBecauseOfMissingXDisplay) {
- return Expectation.FAIL;
- }
-
if (_browserTestFailure) {
return Expectation.RUNTIME_ERROR;
}
return Expectation.PASS;
}
- bool _didFailBecauseOfMissingXDisplay() {
- // Browser case:
- // If the browser test failed, it may have been because content shell
- // and the virtual framebuffer X server didn't hook up, or it crashed with
- // a core dump. Sometimes content shell crashes after it has set the stdout
- // to PASS, so we have to do this check first.
- var stderrLines = decodeUtf8(super.stderr).split("\n");
- for (String line in stderrLines) {
- // TODO(kustermann,ricow): Issue: 7564
- // This seems to happen quite frequently, we need to figure out why.
- if (line.contains(MESSAGE_CANNOT_OPEN_DISPLAY) ||
- line.contains(MESSAGE_FAILED_TO_RUN_COMMAND)) {
- return true;
- }
- }
- return false;
- }
-
bool get _rendererCrashed =>
decodeUtf8(super.stdout).contains("#CRASHED - rendere");
@@ -1334,13 +1336,6 @@ class BrowserControllerTestOutcome extends CommandOutputImpl
factory BrowserControllerTestOutcome(
Command command, BrowserTestOutput result) {
- void validate(String assertion, bool value) {
- if (!value) {
- throw "InvalidFormat sent from browser driving page: $assertion:\n\n"
- "${result.lastKnownMessage}";
- }
- }
-
String indent(String string, int numSpaces) {
var spaces = new List.filled(numSpaces, ' ').join('');
return string
@@ -1374,11 +1369,7 @@ class BrowserControllerTestOutcome extends CommandOutputImpl
stderr = "This test timed out. The delay until the test actually "
"started was: ${result.delayUntilTestStarted}.";
} else {
- // TODO(ricow/kustermann) as soon as we record the state periodically,
- // we will have more information and can remove this warning.
- stderr = "This test has not notified test.py that it started running. "
- "This could be a bug in test.py! "
- "Please contact ricow/whesse";
+ stderr = "This test has not notified test.py that it started running.";
}
}
« tools/testing/dart/status_file_parser.dart ('K') | « tools/testing/dart/test_configurations.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698