Skip to content

Commit a65067f

Browse files
DanTupCommit Queue
authored andcommitted
[dds/dap] Try to fix some flaky tests
While reviewing logs for flaky DAP tests, I found that these tests have been failing sometimes with errors that look like the isolate might not have paused on the `debugger()` call yet: ``` evaluateInFrame: (113) Expression compilation error _buildExpressionEvaluationScope: invalid 'frameIndex' parameter: 0 ``` and ``` evaluateInFrame: (113) Expression compilation error org-dartlang-debug:synthetic_debug_expression:1:1: Error: Undefined name 'myInstance'. myInstance ^^^^^^^^^^ ``` This waits for the isolate to be paused, not just runnable, which I think might fix this. Change-Id: Ib1d6b1c44a7ef93452065aa43c4d05058914db28 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395302 Reviewed-by: Derek Xu <[email protected]> Reviewed-by: Ben Konyi <[email protected]> Commit-Queue: Ben Konyi <[email protected]>
1 parent eaac156 commit a65067f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/dds/test/dap_handler_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import 'package:vm_service/vm_service_io.dart';
1515

1616
import 'common/test_helper.dart';
1717

18-
Future<Isolate> waitForFirstRunnableIsolate(VmService service) async {
18+
Future<Isolate> waitForFirstPausedRunnableIsolate(VmService service) async {
1919
VM vm;
2020
do {
2121
vm = await service.getVM();
@@ -24,7 +24,7 @@ Future<Isolate> waitForFirstRunnableIsolate(VmService service) async {
2424
Isolate isolate;
2525
do {
2626
isolate = await service.getIsolate(isolateId);
27-
} while (!isolate.runnable!);
27+
} while (!isolate.runnable! || isolate.pauseEvent == null);
2828
return isolate;
2929
}
3030

@@ -131,7 +131,7 @@ void main() {
131131

132132
// Wait for the isolate to become runnable as `evaluateInFrame` requires
133133
// the isolate to be runnable.
134-
final isolate = await waitForFirstRunnableIsolate(service);
134+
final isolate = await waitForFirstPausedRunnableIsolate(service);
135135
final isolateId = isolate.id!;
136136

137137
// Get the variable for 'myInstance'.
@@ -178,7 +178,7 @@ void main() {
178178
service = await vmServiceConnectUri(dds!.wsUri!.toString());
179179

180180
// Get the expected isolateId.
181-
final isolate = await waitForFirstRunnableIsolate(service);
181+
final isolate = await waitForFirstPausedRunnableIsolate(service);
182182
final isolateId = isolate.id!;
183183

184184
// Ask DAP for all threads.

0 commit comments

Comments
 (0)