Skip to content

Commit 4115083

Browse files
kenzieschmollCommit Queue
authored andcommitted
[dtd] attempt to fix flaky test connected_app_service_test.dart
Bug: #60762 Change-Id: I1c4197155c9d535ea780530ab9ff0ae9462bf5e5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433741 Auto-Submit: Kenzie Davisson <[email protected]> Commit-Queue: Ben Konyi <[email protected]> Reviewed-by: Ben Konyi <[email protected]>
1 parent 247ae23 commit 4115083

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/dtd/test/utils.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ class DartCliAppProcess {
7070

7171
Future<TestProcess> start() async {
7272
final tmpDir = Directory.systemTemp.createTempSync();
73-
addTearDown(() => tmpDir.deleteSync(recursive: true));
7473

7574
// A simple Dart command line app that will never exit.
7675
const fileName = 'app.dart';
@@ -97,6 +96,10 @@ void main() async {
9796

9897
addTearDown(() async {
9998
await process!.kill();
99+
// Delete [tmpDir] after [process] is killed. Otherwise, the call to
100+
// `tmpDir.deleteSync` may fail with an error: "The process cannot access
101+
// the file because it is being used by another process."
102+
tmpDir.deleteSync(recursive: true);
100103
});
101104

102105
String? uri;

0 commit comments

Comments
 (0)