dart-sdk/tests/standalone/out_of_memory_slow_growth_test.dart
Ryan Macnak ae13d34299 [test] Avoid tests fighting over the default service port.
With no argument, --enable-vm-service and --observe default to port 8181. Passing 0 means to take any available port. If two tests try to use the default port at the same time, one will fail to bind that port.

TEST=ci
Change-Id: Ib7615911db9fb9ab037de1efdd4918b54f59d9e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268840
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-11-10 17:28:48 +00:00

25 lines
660 B
Dart

// Copyright (c) 2020, 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.
// VMOptions=--old_gen_heap_size=20
// VMOptions=--old_gen_heap_size=20 --enable_vm_service=0 --pause_isolates_on_unhandled_exceptions
import "package:expect/expect.dart";
main() {
var leak;
var exceptionThrown = false;
try {
leak = [];
while (true) {
leak = [leak];
}
} on OutOfMemoryError catch (exception) {
leak = null;
exceptionThrown = true;
print("Okay");
}
Expect.isTrue(exceptionThrown);
}