[vm] Fix some Fuchsia tests

Change-Id: I2a6bedeee059bd461cbc00cc5d13df2bdf3154a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156702
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
Liam Appelbe 2020-08-03 22:24:28 +00:00 committed by commit-bot@chromium.org
parent 6a66061703
commit 3ec7ea15ec
7 changed files with 34 additions and 21 deletions

View file

@ -165,20 +165,27 @@ if (is_fuchsia) {
resource_files = [
".packages",
"pkg/testing/test/hello_test.dart",
"tools/addlatexhash.dart",
]
resource_dirs = [
"tests/standalone",
"tests/language_2",
"tests/standalone_2",
"pkg/async_helper",
"pkg/expect",
"pkg/meta",
"pkg/native_stack_traces",
"pkg/smith",
"third_party/pkg/args",
"third_party/pkg/async",
"third_party/pkg/charcode",
"third_party/pkg/collection",
"third_party/pkg/convert",
"third_party/pkg/crypto",
"third_party/pkg/http",
"third_party/pkg/http_parser",
"third_party/pkg/path",
"third_party/pkg/pool",
"third_party/pkg/stack_trace",
"third_party/pkg/typed_data",
]
resources = []

View file

@ -8,7 +8,8 @@
"deprecated-ambient-replace-as-executable",
"root-ssl-certificates",
"isolated-cache-storage",
"isolated-persistent-storage"
"isolated-persistent-storage",
"isolated-temp"
],
"services": [
"fuchsia.deprecatedtimezone.Timezone",

View file

@ -28,11 +28,10 @@ class FuchsiaEmulator {
Process _server;
String _deviceName;
static Future<void> publishPackage(
int emuCpus, String buildDir, String mode) async {
static Future<void> publishPackage(String buildDir, String mode) async {
if (_inst == null) {
_inst = FuchsiaEmulator();
await _inst._start(emuCpus);
await _inst._start();
}
await _inst._publishPackage(buildDir, mode);
}
@ -48,18 +47,11 @@ class FuchsiaEmulator {
arg.replaceAll(Repository.uri.toFilePath(), '/pkg/data/')));
}
Future<void> _start(int emuCpus) async {
Future<void> _start() async {
// Start the emulator.
DebugLogger.info('Starting Fuchsia emulator with $emuCpus CPUs');
_emu = await Process.start('xvfb-run', [
femuTool,
'--image',
'qemu-x64',
'-N',
'--headless',
'-s',
'$emuCpus'
]);
DebugLogger.info('Starting Fuchsia emulator');
_emu = await Process.start(
'xvfb-run', [femuTool, '--image', 'qemu-x64', '-N', '--headless']);
// Wait until the emulator is ready and has a valid device name.
var deviceNameFuture = Completer<String>();

View file

@ -155,7 +155,7 @@ Future testConfigurations(List<TestConfiguration> configurations) async {
}
if (configuration.system == System.fuchsia) {
await FuchsiaEmulator.publishPackage(configuration.taskCount,
await FuchsiaEmulator.publishPackage(
configuration.buildDirectory, configuration.mode.name);
}
}

View file

@ -398,7 +398,7 @@ void EventHandlerImplementation::UpdatePort(intptr_t old_mask,
RemoveFromPort(port_handle_, di);
} else if ((old_mask == 0) && (new_mask != 0)) {
AddToPort(port_handle_, di);
} else if ((old_mask != 0) && (new_mask != 0)) {
} else if ((old_mask != 0) && (new_mask != 0) && (old_mask != new_mask)) {
ASSERT(!di->IsListeningSocket());
RemoveFromPort(port_handle_, di);
AddToPort(port_handle_, di);

View file

@ -9,6 +9,7 @@
#include <errno.h> // NOLINT
#include <fcntl.h> // NOLINT
#include <lib/fdio/fdio.h> // NOLINT
#include <lib/fdio/namespace.h> // NOLINT
#include <libgen.h> // NOLINT
#include <sys/mman.h> // NOLINT
@ -51,8 +52,10 @@ File::~File() {
void File::Close() {
ASSERT(handle_->fd() >= 0);
if (handle_->fd() == STDOUT_FILENO) {
// If stdout, redirect fd to /dev/null.
int null_fd = NO_RETRY_EXPECTED(open("/dev/null", O_WRONLY));
// If stdout, redirect fd to Fuchsia's equivalent of /dev/null.
auto* null_fdio = fdio_null_create();
ASSERT(null_fdio != nullptr);
int null_fd = NO_RETRY_EXPECTED(fdio_bind_to_fd(null_fdio, -1, 0));
ASSERT(null_fd >= 0);
VOID_NO_RETRY_EXPECTED(dup2(null_fd, handle_->fd()));
VOID_NO_RETRY_EXPECTED(close(null_fd));

View file

@ -98,3 +98,13 @@ io/many_directory_operations_test: SkipSlow
io/many_file_operations_test: SkipSlow
package/*: SkipByDesign # Launches VMs in interesting ways.
typed_data_isolate_test: SkipSlow
[ $system == fuchsia ]
# Fuchsia test runner doesn't support multi-tests yet.
deny_listed_test: Skip
io/dart_std_io_pipe_test: Skip
io/platform_resolved_executable_test: Skip
io/signals_exception_test: Skip
io/socket_ipv6_test: Skip
package/invalid_uri_test: Skip
regress_29350_test: Skip