Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory.deleteSync(recursive: true) failing if directory is not empty #38148

Open
tvolkert opened this issue Aug 30, 2019 · 3 comments
Open
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io P2 A bug or feature request we're likely to work on triaged Issue has been triaged by sub team

Comments

@tvolkert
Copy link
Contributor

Observed on the following Dart version:

$ dart --version
Dart VM version: 2.5.0-dev.3.0.flutter-35382f9b14 (Wed Aug 28 18:50:51 2019 +0000) on "macos_x64"
  FileSystemException: Deletion failed, path = '/private/var/folders/dy/cv4xnlnn7sb_4bz47wvmdwjw003g3j/T/file_test_JGEQQ7' (OS Error: Directory not empty, errno = 66)
  dart:io                      FileSystemEntity.deleteSync
  test/chroot_test.dart 45:13  main.<fn>.<fn>.<fn>

The test in question has the following setUp() and tearDown() methods - the exception was thrown in tearDown();

io.Directory tmp;

setUp(() {
  tmp = io.Directory.systemTemp.createTempSync('file_test_');
  tmp = io.Directory(tmp.resolveSymbolicLinksSync());
});

tearDown(() {
  tmp.deleteSync(recursive: true);
});

This failure is intermittent - not 100% reproducible.

@tvolkert tvolkert added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io labels Aug 30, 2019
@tvolkert
Copy link
Contributor Author

@alexmercerind
Copy link

I can confirm. And I'm surprised how noone came across this yet.

I think this affects this aswell: flutter/flutter#64410

Thankyou!

@brianquinlan brianquinlan self-assigned this Aug 2, 2022
@brianquinlan brianquinlan added triaged Issue has been triaged by sub team P2 A bug or feature request we're likely to work on labels Dec 28, 2022
@TMcClain5
Copy link

This is an issue I am seeing as well, it is intermittent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io P2 A bug or feature request we're likely to work on triaged Issue has been triaged by sub team
Projects
None yet
Development

No branches or pull requests

4 participants