Skip to content

Conversation

@harishsk
Copy link
Contributor

@harishsk harishsk commented Feb 8, 2020

TF tests are relying on IClassFixture to carry forward state from test to test. This by default creates excessively long paths that result in file system errors when there is a longer prefix for the source code. I have fixed it to take temp paths with shorter path lengths.

@harishsk harishsk requested a review from a team as a code owner February 8, 2020 02:29
string assetsRelativePath = @"assets";
assetsPath = GetAbsolutePath(assetsRelativePath);
string workspacePath = Path.Combine(assetsPath, "cached");
tempFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Copy link

@yaeldekel yaeldekel Feb 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path.GetTempPath(), Path.GetRandomFileName() [](start = 38, length = 44)

Are these guaranteed to be shorter? #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these are guaranteed to be shorter. Path.GetRandomeFile() only produces a 12 character random filename and in combination with Path.GetTempPath() (which is typically %USERPROFILE%\AppData\Local\Temp) the overall path will be significantly shorter than what what produced earlier.


In reply to: 376950593 [](ancestors = 376950593)

Copy link
Contributor

@frank-dong-ms-zz frank-dong-ms-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@harishsk harishsk merged commit c9d950e into dotnet:master Feb 10, 2020
@harishsk harishsk deleted the tfLongPathFix branch April 21, 2020 23:58
@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants