Skip to content

Conversation

@jonathanpeppers
Copy link
Member

Context: http://build.azdo.io/2971289

Our MaxPathTests seem to be failing on a specific build machine:
DDMBLDW137. I suspect this machine has long paths enabled.

I added a check that attempts to write a long path, and if it succeeds
we can Assert.Ignore these tests appropriately.

@jonathanpeppers
Copy link
Member Author

So I was able to run this on the specific build agent, but the check isn't working:

image

Will look into it.

@jonathanpeppers jonathanpeppers force-pushed the test-long-paths branch 3 times, most recently from bec3165 to 878aec0 Compare August 28, 2019 13:51
@jonathanpeppers jonathanpeppers marked this pull request as ready for review August 28, 2019 19:34
@jonathanpeppers
Copy link
Member Author

jonathanpeppers commented Aug 28, 2019

To see a build where I forced the Windows tests to run on the broken agent: http://build.azdo.io/2985000

MAX_PATH-related tests skipped:

image

The key seemed to be using 255 as a length for the filename, since there is still a limit on file name length in addition to MAX_PATH length. Long paths apparently don't help with the file name length limit:

This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters).

https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation

Assert.Ignore ("This environment supports long paths");
}
var file = NewFile (fileName: "foo".PadRight (250, 'N'));
var file = NewFile (fileName: "foo".PadRight (255, 'N'));
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be going slightly toward asinine territory, but should we P/Invoke GetVolumeInformation() (pinvoke.net) to get the appropriate maximumComponentLength value?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or, should this use FIlesTests.MaxFileName for consistency?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the p/invoke is probably taking it too far, I moved this const to BaseTest so it could just be used everywhere.

Context: http://build.azdo.io/2971289

Our `MaxPathTests` seem to be failing on a specific build machine:
`DDMBLDW137`. I suspect this machine has long paths enabled.

I added a check that attempts to write a long path, and if it succeeds
we can `Assert.Ignore` these tests appropriately.

A filename can only be 255 characters, so I added a constant for this
value so the various tests can use it.
Temporarily require `$(Agent.Name)` = `DDMBLDW137`
This reverts commit 878aec0.
@jonpryor jonpryor merged commit a160fcf into dotnet:master Aug 29, 2019
@jonathanpeppers jonathanpeppers deleted the test-long-paths branch August 29, 2019 13:37
jonpryor pushed a commit that referenced this pull request Sep 4, 2019
Context: http://build.azdo.io/2971289

Our `MaxPathTests` (a3009f7) seem to be failing on a specific build
machine: DDMBLDW137.  I suspect this machine has long paths enabled.

I added a check that attempts to write a long path, and if it
succeeds we can `Assert.Ignore()` these tests appropriately.

A filename can only be 255 characters, so I added a constant for this
value so the various tests can use it.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2024
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.

2 participants