| 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());
|
| });
|
| }
|
|
|
|
|