Skip to content

Commit 1ddbc44

Browse files
derekxu16Commit Queue
authored andcommitted
[VM/Service] Tweak profile_startup_cli_flag_test to make it less flaky
The `--profile-period` argument is used when calculating a sample buffer size that satisfies the `--sample-buffer-duration` argument, so this CL changes the `--profile-period` argument we pass from 100 to 500, because the profiler is more likely to actually hit that rate of sampling. This CL also changes `testeeMain` to spin for 10 seconds instead of 5 seconds, to make it more likely to fill up the sample buffer. Issue: #61191 Change-Id: Ic18b47f86bd2495b7df1af4d7f886fb11aa42812 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442242 Commit-Queue: Derek Xu <[email protected]> Reviewed-by: Ben Konyi <[email protected]>
1 parent a56db1a commit 1ddbc44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/vm_service/test/profile_startup_cli_flag_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void testeeMain() {
1515
print('Testee doing something.');
1616
final stopwatch = Stopwatch();
1717
stopwatch.start();
18-
while (stopwatch.elapsedMilliseconds < 5000) {}
18+
while (stopwatch.elapsedMilliseconds < 10000) {}
1919
stopwatch.stop();
2020
print('Testee did something.');
2121
}
@@ -30,7 +30,7 @@ final tests = <IsolateTest>[
3030
// `get_perfetto_cpu_samples_rpc_test` does.
3131
//
3232
// `--max-profile-depth=2` and `--sample-buffer-duration=1` are passed to
33-
// [runIsolateTests] below, and [testeeMain] spins for 5 seconds, so the
33+
// [runIsolateTests] below, and [testeeMain] spins for 10 seconds, so the
3434
// profiler sample buffer should be full once [testeeMain] has finished
3535
// running. If `--profile-startup` is working as intended, then the two
3636
// [service.getPerfettoCpuSamples] calls below should deliver consistent
@@ -101,7 +101,7 @@ Future<void> main([args = const <String>[]]) => runIsolateTests(
101101
extraArgs: [
102102
'--profiler',
103103
'--profile-startup',
104-
'--profile-period=100',
104+
'--profile-period=500',
105105
'--max-profile-depth=2',
106106
'--sample-buffer-duration=1',
107107
],

0 commit comments

Comments
 (0)