Skip to content

Commit 4916ddb

Browse files
mkustermannCommit Queue
authored andcommitted
[gardening] SkipByDesign tests on Android that cannot work there
Tests that use subprocess calls to things not avilable on the Android devices that the test runner uses will not work. => SkipByDesign those tests. Make one test work on Android by filtering out `WARNING: linker` warnings printed to `stderr` by the AOT runtime (probably `dlopen()` produces those warnings) TEST=Fixes tests on android (or SkipByDesign them where appropriate) Change-Id: I6ebef72d12bfbff0106224b6ee4f23b912298439 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438180 Commit-Queue: Martin Kustermann <[email protected]> Reviewed-by: Slava Egorov <[email protected]> Reviewed-by: Alexander Markov <[email protected]>
1 parent 9b916b2 commit 4916ddb

File tree

2 files changed

+32
-15
lines changed

2 files changed

+32
-15
lines changed

tests/standalone/io/unix_socket_test.dart

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -840,24 +840,38 @@ Future testStdioMessage(String tempDirPath, {bool caller = false}) async {
840840
Platform.script.toFilePath(),
841841
'--start-stdio-message-test',
842842
]);
843-
String processStdout = "";
844-
String processStderr = "";
845-
process.stdout.transform(utf8.decoder).listen((line) {
846-
processStdout += line;
847-
print('stdout:>$line<');
848-
});
849-
process.stderr.transform(utf8.decoder).listen((line) {
850-
processStderr += line;
851-
print('stderr:>$line<');
852-
});
843+
final processStdout = <String>[];
844+
final processStderr = <String>[];
845+
process.stdout
846+
.transform(utf8.decoder)
847+
.transform(const LineSplitter())
848+
.listen((line) {
849+
processStdout.add(line);
850+
print('stdout:>$line<');
851+
});
852+
process.stderr
853+
.transform(utf8.decoder)
854+
.transform(const LineSplitter())
855+
.listen((line) {
856+
// Ignore runtime linker errors from Android AOT runtime.
857+
// TODO(http://dartbug.com/61028): Once this is addressed we may be
858+
// able to restore this test to what it was originally.
859+
if (!line.startsWith('WARNING: linker')) {
860+
processStderr.add(line);
861+
print('stderr:>$line<');
862+
}
863+
});
853864
process.stdin.writeln('Caller wrote to stdin');
854865

855866
Expect.equals(0, await process.exitCode);
856-
Expect.equals("client sent a message\nHello, server!\n", processStdout);
857-
Expect.equals(
858-
"client wrote to stderr\nHello, server too!\n",
859-
processStderr,
860-
);
867+
Expect.listEquals([
868+
'client sent a message',
869+
'Hello, server!',
870+
], processStdout);
871+
Expect.listEquals([
872+
'client wrote to stderr',
873+
'Hello, server too!',
874+
], processStderr);
861875
return;
862876
}
863877

tests/standalone/standalone_vm.status

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ link_natives_lazily_test: SkipByDesign # Not supported.
1111
no_allow_absolute_addresses_test: SkipByDesign # Not supported.
1212

1313
[ $system == android ]
14+
embedder_samples_test: SkipByDesign # Uses subprocess calls to things not available on Android device
15+
gn_py_test: SkipByDesign # Uses subprocess calls to things not available on Android device
1416
io/file_stat_test: Skip # Issue 26376
1517
io/file_system_watcher_test: Skip # Issue 26376
1618
io/file_test: Skip # Issue 26376
19+
io/http_on_unix_socket_test: SkipByDesign # Uses curl, not available on Android device
1720
io/many_pending_secure_sockets_test: Skip # Too expensive
1821
io/non_utf8_output_test: Skip # The Android command runner doesn't correctly handle non-UTF8 formatted output. https://github.com/dart-lang/sdk/issues/28872
1922
io/process_exit_test: Skip # Issue 29578

0 commit comments

Comments
 (0)