-
Notifications
You must be signed in to change notification settings - Fork 326
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
Fix vstest.console.exe grabs exclusive read access to its test container #1660
Fix vstest.console.exe grabs exclusive read access to its test container #1660
Conversation
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
EqtTrace.Warning("GetFrameWorkFromMetadata: failed to determine TargetFrameworkVersion: {0} for assembly: {1}", ex, filePath); | ||
EqtTrace.Warning("AssemblyMetadataProvider.GetFrameWork: failed to determine TargetFrameworkVersion: {0} for assembly: {1}", ex, filePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TargetFrameworkVersion: {0}
Here {0} is ex and not TargetFrameworkVersion. Can you have a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameters are interchanged.. also please inline it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TargetFrameworkVersion: {0} Here {0} is ex and not TargetFrameworkVersion. Can you have a look?
Done.
The parameters are interchanged.. also please inline it.
Making inline causes additional statement string.format which we don't want be cause most of time we don't in diag mode. See the below IL code.
@@ -135,6 +161,7 @@ public void GetFrameWorkForNativeDll() | |||
|
|||
private void TestDotnetAssemblyArch(string projectName, string framework, Architecture expectedArch, long expectedElapsedTime) | |||
{ | |||
this.isManagedAssemblyArchitectureTest = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test for checking FileShare working or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually now we don't need FileShare. Added FileHelperTests.cs
to add required test.
@@ -99,7 +99,7 @@ private static ISymbolReader GetSymbolReader(string binaryPath) | |||
// For remote scenario, also look for pdb in current directory, (esp for UWP) | |||
// The alternate search path should be an input from Adapters, but since it is not so currently adding a HACK | |||
pdbFilePath = !File.Exists(pdbFilePath) ? Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(pdbFilePath)) : pdbFilePath; | |||
using (var stream = new FileHelper().GetStream(pdbFilePath, FileMode.Open, FileAccess.Read)) | |||
using (var stream = new FileHelper().GetStream(pdbFilePath, FileMode.Open, FileAccess.Read, FileShare.Read)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibility to have a single method for GetStreamForRead in FileHelper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change not required now. we don't want to add new method which leads to additional learning . The helper is just wrapper to IO apis.
|
||
/// <summary> | ||
/// Gets the instance. | ||
/// </summary> | ||
internal static AssemblyMetadataProvider Instance => instance ?? (instance = new AssemblyMetadataProvider()); | ||
internal static AssemblyMetadataProvider Instance => instance ?? (instance = new AssemblyMetadataProvider(new FileHelper())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why internal.. make it public.. the class is internal already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
internal static AssemblyMetadataProvider Instance => instance ?? (instance = new AssemblyMetadataProvider()); | ||
internal static AssemblyMetadataProvider Instance => instance ?? (instance = new AssemblyMetadataProvider(new FileHelper())); | ||
|
||
internal AssemblyMetadataProvider(IFileHelper fileHelper) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This we don't expect to used by any other assembly except test assembly. If we make this public we will lose the flexibility to change the signature.
58054ab
to
c1b0202
Compare
Description
Related issue
#1638