Skip to content

Commit a252a46

Browse files
authored
add retry logic to try and make dtd_test less flaky (#214)
1 parent 9e0b973 commit a252a46

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkgs/dart_mcp_server/test/tools/dtd_test.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import 'package:dart_mcp_server/src/mixins/dtd.dart';
1212
import 'package:dart_mcp_server/src/server.dart';
1313
import 'package:dart_mcp_server/src/utils/analytics.dart';
1414
import 'package:dart_mcp_server/src/utils/constants.dart';
15+
import 'package:devtools_shared/devtools_shared.dart';
1516
import 'package:test/test.dart';
1617
import 'package:unified_analytics/testing.dart';
1718
import 'package:unified_analytics/unified_analytics.dart' as ua;
@@ -196,7 +197,11 @@ void main() {
196197
isFlutter: false,
197198
);
198199
await pumpEventQueue();
199-
expect(server.activeVmServices.length, 1);
200+
await runWithRetry(
201+
callback: () => expect(server.activeVmServices.length, 1),
202+
maxRetries: 5,
203+
);
204+
200205
// TODO: It can cause an error in the mcp server if we haven't set
201206
// up the listeners yet.
202207
await Future<void>.delayed(const Duration(seconds: 1));

0 commit comments

Comments
 (0)