-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
pub/io_test times out on windows #7505
Comments
I've fixed a couple of bugs in the windows pub/io_test. It's no longer flaky. It not reliably hangs and then times out. The issue seems to be in dart:io. The last test in io_test sets up a symlink cycle (using a junction point) and then walks it recursively. At some point, a list directory call in dart:io just... doesn't return. I'm bouncing this over to dart:io because I'm guessing it's not supposed to do that. There is also an issue in that the logic pub is trying to do here doesn't seem to work on windows. It tries to detect the cycle by calling fullPathSync() hoping that that will return the resolved real path. But it seems to return the symlink path instead. I'm not sure if that's actually how Windows is supposed to behave or not, though. Ultimately, all of this boils down to us implementing our own recursive directory lister in pub to workaround #7358. If we can get back to using dart:io for that, this code will go away completely. Set owner to @madsager. |
The test pub/io_test hangs because the cycle detection code in pub/io.dart listDir is not working, so the directory listing recurses into the cycle until MAX_PATH is hit. Then the directory listing fails, and somehow onDone(false) is called, which does not complete the completer with an error. If this is added to lister.onDone, then the test does not hang. I don't know how onDone(false) is being called without onError being called on the lister. This is a bug. |
The lister now calls onError, with a PATH_TOO_LONG exception, with my upcoming CL that avoids buffer overflows. So this bug is changed to a fail. I think we need a test whether two paths refer to the same directory (or file) to fix the problem - I'll work on adding it to dart:io. |
We have now fixed Directory.list(recursive: true, followLinks: true) so that it terminates upon finding recursive symlinks, so this should be fixable now. Currently, listDir in pub's io.dart tries to use .fullPathSync to get a reduced path, but that doesn't work (and won't work) on Windows. You should use FileSystemEntity.identical( path1, path2 ) to find out if two paths point to the same thing, or else use Directory.list(recursive: true, followLinks: true), now that it should support all the cases you need. So I'm relabeling this as a Pub bug now, and handing it back to you. Let me know if you need more capabilities from Directory and Link. cc @nex3. |
Sounds good, thanks! |
We're still waiting on issue #9832 for What do you mean when you say [File.fullPathSync] doesn't work on Windows? What happens? What's the correct way to get a fully-resolved path? |
Added this to the M5 milestone. |
Added Started label. |
I thought I had a fix for this with this patch: https://code.google.com/p/dart/source/detail?r=22295 But it fails on Linux: FAIL: listDir works with recursive symlinks It works fine on Mac and Windows. Nathan, can you take a look at this and tell me what you think? |
I'm not a fan of the solution in r22295. That makes listDir O(n^2), which is pretty bad since we run it against some pretty big directory structures in practice. I'm going to try to come up with a more efficient solution to this. |
SGTM! |
Fixed by r22477 and r22484. Added Fixed label. |
This issue has been moved to dart-lang/pub#389. |
This has been flaking a lot lately:
http://build.chromium.org/p/client.dart/builders/pub-win/builds/1315
http://build.chromium.org/p/client.dart/builders/pub-win/builds/1322
http://build.chromium.org/p/client.dart/builders/pub-win/builds/1324
I will mark it as flaky in the log for now - please update accordingly when fixing.
The text was updated successfully, but these errors were encountered: