[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>
This commit is contained in:
Martin Kustermann
2025-03-05 04:58:05 -08:00
parent d3027d5ba4
commit ee32a22712
+5 -1
View File
@@ -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 'dart:io';
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();