Skip to content

Commit c8151ab

Browse files
derekxu16Commit Queue
authored andcommitted
[VM/Service] Write the info files associated with resident compilers started by tests into temp directories
Also re-enables the tests on vm-win-release-x64 because having different tests try to communicate with the same resident compiler in parallel was definitely a source of flakiness, and I don't think there's any way of knowing whether or not it was the only source of flakiness without re-enabling it on the bots. Issue: #59909 Change-Id: I831f32779e0946fb35811edaeaaa5ddb38e51d97 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404460 Reviewed-by: Ben Konyi <[email protected]> Commit-Queue: Derek Xu <[email protected]>
1 parent ec8f330 commit c8151ab

File tree

2 files changed

+55
-15
lines changed

2 files changed

+55
-15
lines changed

pkg/pkg.status

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,7 @@ vm/test/kernel_front_end_test: Slow, Pass
6767
vm/test/transformations/ffi_test: Slow, Pass # https://github.com/dart-lang/sdk/issues/54950
6868
vm/test/transformations/type_flow/transformer_test: Slow, Pass
6969
vm/testcases/*: SkipByDesign # These are not tests but input for tests.
70-
vm_service/test/breakpoint_resolution_after_reloading_with_resident_compiler_test: Skip # issue 59909
7170
vm_service/test/cpu_samples_stream_test: Slow, Pass # Requires CPU sample buffer to fill.
72-
vm_service/test/eval_with_resident_compiler_test: Skip # issue 59909
73-
vm_service/test/evaluate_in_frame_rpc_with_resident_compiler_test: Skip # issue 59909
74-
vm_service/test/evaluate_in_frame_with_scope_with_resident_compiler_test: Skip # issue 59909
75-
vm_service/test/evaluate_with_scope_with_resident_compiler_test: Skip # issue 59999
7671
vm_service/test/get_cpu_samples_rpc_test: Slow, Pass # Does some computation to ensure CPU samples are collected.
7772
vm_service/test/get_perfetto_cpu_samples_rpc_test: Slow, Pass # Does some computation to ensure CPU samples are collected.
7873
vm_service/test/reload_sources_with_resident_compiler_test: Skip # issue 59909
@@ -354,6 +349,13 @@ dartdev/test/commands/info_windows_test: SkipByDesign
354349
analysis_server/test/integration/edit/sort_members_test: Slow, Pass
355350
analysis_server/test/socket_server_test: Skip # Pass, Slow
356351

352+
[ $arch != x64 || $mode != release || $runtime != vm || $system != windows ]
353+
vm_service/test/breakpoint_resolution_after_reloading_with_resident_compiler_test: Skip # issue 59909
354+
vm_service/test/eval_with_resident_compiler_test: Skip # issue 59909
355+
vm_service/test/evaluate_in_frame_rpc_with_resident_compiler_test: Skip # issue 59909
356+
vm_service/test/evaluate_in_frame_with_scope_with_resident_compiler_test: Skip # issue 59909
357+
vm_service/test/evaluate_with_scope_with_resident_compiler_test: Skip # issue 59999
358+
357359
[ $mode == debug || $runtime != vm || $system == android ]
358360
vm/test/modular_kernel_plus_aot_test: SkipByDesign # This test should only run if binary is run from build dir
359361

pkg/vm_service/test/common/test_helper.dart

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@ class _ServiceTesteeLauncher {
115115
bool pauseOnUnhandledExceptions,
116116
bool testeeControlsServer,
117117
bool useAuthToken,
118-
bool shouldTesteeBeLaunchedWithDartRunResident,
118+
119+
/// If non-null, any compilation requests sent from the testee VM will be
120+
/// sent to the resident frontend compiler associated with
121+
/// [residentCompilerInfoFilePath] rather than the testee VM's kernel
122+
/// isolate. If null, then those requests will be sent to the testee VM's
123+
/// kernel isolate.
124+
String? residentCompilerInfoFilePath,
119125
List<String>? experiments,
120126
List<String>? extraArgs,
121127
) {
@@ -125,7 +131,7 @@ class _ServiceTesteeLauncher {
125131
pauseOnUnhandledExceptions,
126132
testeeControlsServer,
127133
useAuthToken,
128-
shouldTesteeBeLaunchedWithDartRunResident,
134+
residentCompilerInfoFilePath,
129135
experiments,
130136
extraArgs,
131137
);
@@ -137,7 +143,13 @@ class _ServiceTesteeLauncher {
137143
bool pauseOnUnhandledExceptions,
138144
bool testeeControlsServer,
139145
bool useAuthToken,
140-
bool shouldTesteeBeLaunchedWithDartRunResident,
146+
147+
/// If non-null, any compilation requests sent from the testee VM will be
148+
/// sent to the resident frontend compiler associated with
149+
/// [residentCompilerInfoFilePath] rather than the testee VM's kernel
150+
/// isolate. If null, then those requests will be sent to the testee VM's
151+
/// kernel isolate.
152+
String? residentCompilerInfoFilePath,
141153
List<String>? experiments,
142154
List<String>? extraArgs,
143155
) {
@@ -169,8 +181,12 @@ class _ServiceTesteeLauncher {
169181
fullArgs.add('--enable-vm-service:0');
170182
}
171183

172-
if (shouldTesteeBeLaunchedWithDartRunResident) {
173-
fullArgs.addAll(['run', '--resident']);
184+
if (residentCompilerInfoFilePath != null) {
185+
fullArgs.addAll([
186+
'run',
187+
'--resident',
188+
'--resident-compiler-info-file=$residentCompilerInfoFilePath',
189+
]);
174190
}
175191
fullArgs.addAll(args);
176192

@@ -202,7 +218,13 @@ class _ServiceTesteeLauncher {
202218
bool pauseOnUnhandledExceptions,
203219
bool testeeControlsServer,
204220
bool useAuthToken,
205-
bool shouldTesteeBeLaunchedWithDartRunResident,
221+
222+
/// If non-null, any compilation requests sent from the testee VM will be
223+
/// sent to the resident frontend compiler associated with
224+
/// [residentCompilerInfoFilePath] rather than the testee VM's kernel
225+
/// isolate. If null, then those requests will be sent to the testee VM's
226+
/// kernel isolate.
227+
String? residentCompilerInfoFilePath,
206228
List<String>? experiments,
207229
List<String>? extraArgs,
208230
) {
@@ -212,7 +234,7 @@ class _ServiceTesteeLauncher {
212234
pauseOnUnhandledExceptions,
213235
testeeControlsServer,
214236
useAuthToken,
215-
shouldTesteeBeLaunchedWithDartRunResident,
237+
residentCompilerInfoFilePath,
216238
experiments,
217239
extraArgs,
218240
).then((p) {
@@ -286,6 +308,16 @@ class _ServiceTesterRunner {
286308
bool allowForNonZeroExitCode = false,
287309
VmServiceFactory serviceFactory = VmService.defaultFactory,
288310
}) async {
311+
final tempDir = io.Directory.systemTemp.createTempSync();
312+
final String? residentCompilerInfoFilePath;
313+
if (shouldTesteeBeLaunchedWithDartRunResident) {
314+
residentCompilerInfoFilePath =
315+
'${tempDir.path}${io.Platform.pathSeparator}'
316+
'resident_compiler_info.txt';
317+
} else {
318+
residentCompilerInfoFilePath = null;
319+
}
320+
289321
final process = _ServiceTesteeLauncher(scriptName);
290322
late VmService vm;
291323
late IsolateRef isolate;
@@ -297,7 +329,7 @@ class _ServiceTesterRunner {
297329
pauseOnUnhandledExceptions,
298330
testeeControlsServer,
299331
useAuthToken,
300-
shouldTesteeBeLaunchedWithDartRunResident,
332+
residentCompilerInfoFilePath,
301333
experiments,
302334
extraArgs,
303335
)
@@ -366,13 +398,19 @@ $st
366398
final exitCode = await process.exitCode;
367399
if (shouldTesteeBeLaunchedWithDartRunResident) {
368400
print(
369-
'** Shutting down resident frontend compiler that was used by VM '
401+
'** Shutting down resident frontend compiler associated with '
402+
'$residentCompilerInfoFilePath that was used by VM '
370403
'Service tests',
371404
);
372405
await io.Process.run(
373406
io.Platform.executable,
374-
['compilation-server', 'shutdown'],
407+
[
408+
'compilation-server',
409+
'shutdown',
410+
'--resident-compiler-info-file=$residentCompilerInfoFilePath',
411+
],
375412
);
413+
tempDir.deleteSync(recursive: true);
376414
}
377415
if (exitCode != 0) {
378416
if (!(process.killedByTester || allowForNonZeroExitCode)) {

0 commit comments

Comments
 (0)