Index: tools/testing/dart/test_progress.dart |
diff --git a/tools/testing/dart/test_progress.dart b/tools/testing/dart/test_progress.dart |
index 3fdfbf3fa734a438dbf45bd27b96aa0c6ec35b84..b93294b389b0a3348edc9a2625fb281e195d8547 100644 |
--- a/tools/testing/dart/test_progress.dart |
+++ b/tools/testing/dart/test_progress.dart |
@@ -174,6 +174,31 @@ class ExitCodeSetter extends EventListener { |
} |
} |
+class IgnoredTestMonitor extends EventListener { |
+ static final int maxIgnored = 5; |
+ |
+ int countIgnored = 0; |
+ |
+ void done(TestCase test) { |
+ if (test.lastCommandOutput.result(test) == Expectation.IGNORE) { |
+ countIgnored++; |
+ if (countIgnored > maxIgnored) { |
+ print("/nMore than $maxIgnored tests were ignored due to flakes in"); |
+ print("the test infrastructure. Notify whesse@google.com."); |
+ print("Output of the last ignored test was:"); |
+ print(_buildFailureOutput(test)); |
+ exit(1); |
+ } |
+ } |
+ } |
+ |
+ void allDone() { |
+ if (countIgnored > 0) { |
+ print("Ignored $countIgnored tests due to flaky infrastructure"); |
+ } |
+ } |
+} |
+ |
class FlakyLogWriter extends EventListener { |
void done(TestCase test) { |
if (test.isFlaky && test.result != Expectation.PASS) { |