[gardening] Make standalone/regress_52715_test more robust
The `vm-service` is starting somewhat concurrently with the `main` isolate
and the `main` can therefore not assume it's the only one allocating
memory in the process.
By delaying the measurement logic in `main`, it's more likely the
`vm-service` will have done it's work and reached steady memory state.
This makes the test more robust.
Change-Id: I5a641ad98ba269b8c5961ea6d20b06223621a4e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413641
Reviewed-by: Daco Harkes <dacoharkes@google.com>
diff --git a/tests/standalone/regress_52715_test.dart b/tests/standalone/regress_52715_test.dart
index f797356..1ecc77a2 100644
--- a/tests/standalone/regress_52715_test.dart
+++ b/tests/standalone/regress_52715_test.dart
@@ -2,6 +2,8 @@
// 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=--deterministic
+
// Formatting can break multitests, so don't format them.
// dart format off
@@ -12,8 +14,10 @@
import 'package:expect/expect.dart';
void main() async {
- final startRss = ProcessInfo.currentRss; //# measure: ok
+ // Wait to give `vm-service` isolate to startup and initialize.
+ await Future.delayed(const Duration(seconds: 1));
+ final startRss = ProcessInfo.currentRss; //# measure: ok
for (var i = 0; i < 1024; i++) {
final subscription = Directory.systemTemp.watch().listen((event) {});
await subscription.cancel();