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

pub/io_test times out on windows #7505

Closed
ricowind opened this issue Dec 19, 2012 · 14 comments
Closed

pub/io_test times out on windows #7505

ricowind opened this issue Dec 19, 2012 · 14 comments
Assignees
Milestone

Comments

@ricowind
Copy link
Contributor

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.

@munificent
Copy link
Member

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.
Removed Priority-High, Area-Pub labels.
Added Priority-Medium, Area-IO labels.
Changed the title to: "pub/io_test times out on windows".

@madsager
Copy link
Contributor

madsager commented Feb 5, 2013

Calls to directory list should definitely return.


cc @sgjesse.
Set owner to @whesse.
Added Accepted label.

@whesse
Copy link
Contributor

whesse commented Feb 6, 2013

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.

@whesse
Copy link
Contributor

whesse commented Feb 13, 2013

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.

@whesse
Copy link
Contributor

whesse commented Apr 10, 2013

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.
cc @munificent.
Removed the owner.
Removed Area-IO label.
Added Area-Pub, Triaged labels.

@munificent
Copy link
Member

Sounds good, thanks!

@nex3
Copy link
Member

nex3 commented Apr 10, 2013

We're still waiting on issue #9832 for Directory.list to have the behavior we need.

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?

@munificent
Copy link
Member

Added this to the M5 milestone.

@munificent
Copy link
Member

Added Started label.

@munificent
Copy link
Member

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
  Expected future to complete successfully, but it failed with Expected: equals
<[/tmp/temp_dir1_iIEsHP/file1.txt, /tmp/temp_dir1_iIEsHP/linkdir]> unordered
       but: has no match for element '/tmp/temp_dir1_iIEsHP/file1.txt' at
position 0.

It works fine on Mac and Windows. Nathan, can you take a look at this and tell me what you think?


Set owner to @nex3.
Added Accepted label.

@nex3
Copy link
Member

nex3 commented May 7, 2013

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.

@munificent
Copy link
Member

SGTM!

@nex3
Copy link
Member

nex3 commented May 7, 2013

Fixed by r22477 and r22484.


Added Fixed label.

@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/pub#389.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants