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

Tests fail with PathTooLongException on fresh clone #1768

Closed
kevinkuszyk opened this issue Nov 25, 2015 · 9 comments
Closed

Tests fail with PathTooLongException on fresh clone #1768

kevinkuszyk opened this issue Nov 25, 2015 · 9 comments

Comments

@kevinkuszyk
Copy link

I wanted to try fixing #1743, but when I run the build.ps1 script from 26a401e I get the following error:

xUnit.net DNX Runner (32-bit DNX 4.5.1)
  Discovering: NuGet.Commands.Test
  Discovered:  NuGet.Commands.Test
  Starting:    NuGet.Commands.Test
      System.IO.PathTooLongException : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
      Stack Trace:
           at System.IO.PathHelper.Append(Char value)
           at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
           at System.IO.Path.GetDirectoryName(String path)
        C:\Projects\NuGet.Client\src\NuGet.Core\NuGet.Packaging\PackageExtraction\NuGetPackageUtils.cs(291,0): at NuGet.Packaging.NuGetPackageUtils.ExtractFiles(ZipArchive archive, String targetPath, String nupkgFileName, String hashFileName)
        C:\Projects\NuGet.Client\src\NuGet.Core\NuGet.Packaging\PackageExtraction\NuGetPackageUtils.cs(117,0): at NuGet.Packaging.NuGetPackageUtils.<>c__DisplayClass1_0.<<InstallFromSourceAsync>b__0>d.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
        C:\Projects\NuGet.Client\src\NuGet.Core\NuGet.Common\ConcurrencyUtilities.cs(44,0): at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLocked>d__0`1.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
        C:\Projects\NuGet.Client\src\NuGet.Core\NuGet.Common\ConcurrencyUtilities.cs(57,0): at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLocked>d__0`1.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
        C:\Projects\NuGet.Client\src\NuGet.Core\NuGet.Packaging\PackageExtraction\NuGetPackageUtils.cs(52,0): at NuGet.Packaging.NuGetPackageUtils.<InstallFromSourceAsync>d__1.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
        C:\Projects\NuGet.Client\src\NuGet.Core\NuGet.Commands\RestoreCommand.cs(923,0): at NuGet.Commands.RestoreCommand.<InstallPackageAsync>d__22.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
        C:\Projects\NuGet.Client\src\NuGet.Core\NuGet.Commands\RestoreCommand.cs(905,0): at NuGet.Commands.RestoreCommand.<>c__DisplayClass21_1.<<InstallPackagesAsync>b__2>d.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
        C:\Projects\NuGet.Client\src\NuGet.Core\NuGet.Commands\RestoreCommand.cs(908,0): at NuGet.Commands.RestoreCommand.<InstallPackagesAsync>d__21.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
        C:\Projects\NuGet.Client\src\NuGet.Core\NuGet.Commands\RestoreCommand.cs(329,0): at NuGet.Commands.RestoreCommand.<TryRestore>d__9.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
        C:\Projects\NuGet.Client\src\NuGet.Core\NuGet.Commands\RestoreCommand.cs(217,0): at NuGet.Commands.RestoreCommand.<ExecuteRestoreAsync>d__8.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
        C:\Projects\NuGet.Client\src\NuGet.Core\NuGet.Commands\RestoreCommand.cs(70,0): at NuGet.Commands.RestoreCommand.<ExecuteAsync>d__7.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
        C:\Projects\NuGet.Client\test\NuGet.Core.Tests\NuGet.Commands.Test\UWPRestoreTests.cs(371,0): at NuGet.Commands.Test.UWPRestoreTests.<UWPRestore_UWPAppWithOffice365Packages>d__7.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  Finished:    NuGet.Commands.Test
=== TEST EXECUTION SUMMARY ===
   NuGet.Commands.Test  Total: 95, Errors: 0, Failed: 1, Skipped: 0, Time: 45.087s
@yishaigalatzer
Copy link

@kevinkuszyk thanks for reporting this. We clone to a local folder that is typically something like c:\nuget\nuget.client another thing that could be an issue is where you temp folder is located (make sure it is in a relatively short path)

@yishaigalatzer
Copy link

Closing as we didn't hear back

@kevinkuszyk
Copy link
Author

Apologies for taking a while to reply - I'm catching up after Christmas.

I still get this error (and a few more) on the latest this afternoon:

image

As you can see, I'm in C:\Projects\NuGet.Client. As for the temp folder it's c:\temp, unless there's a setting to change it somewhere?

I can send the full output from the build script if that would help? Also, can you re-open this issue?

@yishaigalatzer
Copy link

I would assume that either your temp folder (which is typically not under c:\temp but under the user profile) or your user profile is stored at some relatively long path.

It is hard to tell, but the easiest way to deal with this is to run the tests from visual studio and figure out the broken test, and let us know. You can either submit a fix or figure out what went wrong.

@yishaigalatzer yishaigalatzer reopened this Jan 6, 2016
@kevinkuszyk
Copy link
Author

The temp folder was the culprit - I'd forgotten it defaults to %userprofile\AppData\Local\Temp. When I switched it over to c:\temp it fixed these tests. Would you accept a PR to set the temp folder in the build.ps1 or to mention it on the readme?

I also get a load of other tests failing (there was a pull request from daravind/FixRunTest which may have fixed them? Unfortunately that branch didn't build on my machine, and I can't find the PR today).

@yishaigalatzer
Copy link

A readme update should be fine. Changing to c:\temp is not always going to work and is not always necessary

@yishaigalatzer
Copy link

As for public CI, we will get to our at some point, probably not in this version.

@yishaigalatzer
Copy link

@kevinkuszyk do you still plan on a PR here, I'm closing (since it seems low pri) but feel free to send one out.

@kevinkuszyk
Copy link
Author

@yishaigalatzer thanks for the nudge - this had slipped my mind.

I don't think there is any need for a PR now, as the latest clone from DEV builds on my machine with only the follow error which looks to be unrelated:

image

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

2 participants