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

DataCollectors TestResults logs hitting MAXPATH errors #3102

Closed
NGloreous opened this issue Oct 13, 2021 · 1 comment
Closed

DataCollectors TestResults logs hitting MAXPATH errors #3102

NGloreous opened this issue Oct 13, 2021 · 1 comment

Comments

@NGloreous
Copy link
Contributor

Description

Seeing the below error related to a log file attached from a custom data collector. The issue occurs when vstest tries to copy the file here.

The root cause is that the resulting path to copy to is longer than MAXPATH.

For now we will work around this by reducing the length of the file name. We'd like to keep including the test name in the file name as it's useful later on when debugging issues but we can't control how long people name their tests.

It would be great if vstest could work around the max path issue or at least have an option to shorten the directories it creates (currently files get copied to <ResultsDirector>/TestResults/<GUID>/<GUID>/<filename>).

Steps to reproduce

Create a data collector which creates a file where the resulting path to copy the file will be longer than MAXPATH.

Expected behavior

No failures, and logs properly copied.

Actual behavior

vstest fails to copy the logs with the below error and returns a non-zero exit code.

Data collector 'FiddlerClientDataCollector' message: System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\data\CHT\a7a84089\JWD_7b08af31\TestResults\181ee68a-56fb-4daf-8e91-df7e289796cb\8d76b1a3-21aa-df30-9ab3-a0c62348ecc3\Process_32200_Test_EnsureCrossTenantUser_NativeClientSignInWithoutOidAndPuidInToken_Access__Positive_Test_Async_8d76b1a3-21aa-df30-9ab3-a0c62348ecc3.SAZ'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at Microsoft.VisualStudio.TestPlatform.Common.DataCollector.DataCollectionAttachmentManager.<>c__DisplayClass21_0.<AddNewFileTransfer>b__0().
@nohwnd
Copy link
Member

nohwnd commented Aug 3, 2023

I would like to eventually do this by providing a common templating service that will allow us and you to specify the path in similar way as you outlined, but in all extensions not just in one specific one as it is done now. Saving this issue to a design doc. But we won't fix right now.

@nohwnd nohwnd closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants