Skip to content

Commit ee32a22

Browse files
committed
[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 <[email protected]>
1 parent d3027d5 commit ee32a22

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/standalone/regress_52715_test.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// VMOptions=--deterministic
6+
57
// Formatting can break multitests, so don't format them.
68
// dart format off
79

@@ -12,8 +14,10 @@ import 'dart:io';
1214
import 'package:expect/expect.dart';
1315

1416
void main() async {
15-
final startRss = ProcessInfo.currentRss; //# measure: ok
17+
// Wait to give `vm-service` isolate to startup and initialize.
18+
await Future.delayed(const Duration(seconds: 1));
1619

20+
final startRss = ProcessInfo.currentRss; //# measure: ok
1721
for (var i = 0; i < 1024; i++) {
1822
final subscription = Directory.systemTemp.watch().listen((event) {});
1923
await subscription.cancel();

0 commit comments

Comments
 (0)