dart-sdk/tests/standalone/io/exit_works_with_blocked_isolate_test.dart
Martin Kustermann 91ea353298 [gardening] Make new standalone/io/exit_works_with_blocked_isolate_test be a nop in the training run
TEST=Fixes standalone/io/exit_works_with_blocked_isolate_test in app-jit mode

Change-Id: Icd4f43dfe524b5a9f8569a520a661289214bfddf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287461
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-03-08 10:22:46 +00:00

25 lines
702 B
Dart

// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import "dart:io";
import "dart:isolate";
final bool isAppJitTrainingRun =
Platform.executableArguments.any((arg) => arg == '--snapshot-kind=app-jit');
child(msg) {
// This should work even though the parent isolate is blocked and won't
// respond to OOB messages such as shutdown requests.
exit(0);
}
main() {
if (isAppJitTrainingRun) return;
Isolate.spawn(child, null);
// The test harness provides no input, so this will block forever.
stdin.readByteSync();
}