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

Unified Diff: tests/standalone/io/process_start_exception_test.dart

Issue 2631223003: Gardening: Mark io/http_basic_test slow. Add debug prints into io/process_start_exception_test. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/process_start_exception_test.dart
diff --git a/tests/standalone/io/process_start_exception_test.dart b/tests/standalone/io/process_start_exception_test.dart
index a1f891e34fb5ad5a4ddccfcfcd100c4f84d4e8d1..2c30400882ce4eaad02304452e4f737da6686358 100644
--- a/tests/standalone/io/process_start_exception_test.dart
+++ b/tests/standalone/io/process_start_exception_test.dart
@@ -8,6 +8,26 @@ import "package:expect/expect.dart";
import 'dart:async';
import 'dart:io';
+// Constants from errno.h
+const ENOENT = 2;
+const EACCES = 13;
+
+// TODO(http://dartbug.com/28299) This code is added in attempt to collect more
+// information about the flakyness this test experiences on Android bots:
+// sometimes the test fails because we get EACCES instead of ENOENT error
+// from the OS.
+checkForAccessError(error) {
+ if (error.errorCode == EACCES) {
+ report(obj) {
+ final stat = obj.statSync();
+ print("${obj} | ${stat.type} | ${stat.modeString()}");
+ }
+
+ report(Directory.current);
+ report(new File("__path_to_something_that_should_not_exist__"));
+ }
+}
+
testStartError() {
Future<Process> processFuture =
Process.start("__path_to_something_that_should_not_exist__",
@@ -15,7 +35,8 @@ testStartError() {
processFuture.then((p) => Expect.fail('got process despite start error'))
.catchError((error) {
Expect.isTrue(error is ProcessException);
- Expect.equals(2, error.errorCode, error.toString());
+ checkForAccessError(error);
+ Expect.equals(ENOENT, error.errorCode, error.toString());
});
}
@@ -27,7 +48,8 @@ testRunError() {
processFuture.then((result) => Expect.fail("exit handler called"))
.catchError((error) {
Expect.isTrue(error is ProcessException);
- Expect.equals(2, error.errorCode, error.toString());
+ checkForAccessError(error);
+ Expect.equals(ENOENT, error.errorCode, error.toString());
});
}
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698