Skip to content

Commit

Permalink
Merge branch 'master' into fqn
Browse files Browse the repository at this point in the history
  • Loading branch information
Haplois committed Nov 19, 2020
2 parents f86a987 + ea986d9 commit ceebbcc
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 71 deletions.
20 changes: 10 additions & 10 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.20509.7">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.20567.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e4584b56c5334067d30a04dd6b2d1d724ed7ccc3</Sha>
<Sha>e65cfb96188c8849e24f6e8f53207eae71689281</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="2.2.0-beta.20509.7">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="2.2.0-beta.20567.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e4584b56c5334067d30a04dd6b2d1d724ed7ccc3</Sha>
<Sha>e65cfb96188c8849e24f6e8f53207eae71689281</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.SignTool" Version="1.0.0-beta.20509.7">
<Dependency Name="Microsoft.DotNet.SignTool" Version="1.0.0-beta.20567.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e4584b56c5334067d30a04dd6b2d1d724ed7ccc3</Sha>
<Sha>e65cfb96188c8849e24f6e8f53207eae71689281</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.20509.7">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.20567.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e4584b56c5334067d30a04dd6b2d1d724ed7ccc3</Sha>
<Sha>e65cfb96188c8849e24f6e8f53207eae71689281</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="1.0.0-beta.20509.7">
<Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="1.0.0-beta.20567.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e4584b56c5334067d30a04dd6b2d1d724ed7ccc3</Sha>
<Sha>e65cfb96188c8849e24f6e8f53207eae71689281</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Maestro.Client" Version="1.1.0-beta.19556.4">
<Uri>https://github.com/dotnet/arcade-services</Uri>
Expand Down
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
<XUnitVersion>2.4.1</XUnitVersion>
<XUnitAbstractionsVersion>2.0.3</XUnitAbstractionsVersion>
<XUnitVSRunnerVersion>2.4.1</XUnitVSRunnerVersion>
<MicrosoftDotNetBuildTasksFeedVersion>2.2.0-beta.20509.7</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetSignToolVersion>1.0.0-beta.20509.7</MicrosoftDotNetSignToolVersion>
<MicrosoftDotNetBuildTasksFeedVersion>2.2.0-beta.20567.6</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetSignToolVersion>1.0.0-beta.20567.6</MicrosoftDotNetSignToolVersion>
<MicrosoftAzureDocumentDBVersion>1.22.0</MicrosoftAzureDocumentDBVersion>
<MicrosoftAzureCosmosDBTableVersion>1.1.2</MicrosoftAzureCosmosDBTableVersion>
<MicrosoftAspNetCoreAllVersion>2.0.0</MicrosoftAspNetCoreAllVersion>
Expand All @@ -73,7 +73,7 @@
<MicrosoftDiaSymReaderNativeVersion>1.7.0</MicrosoftDiaSymReaderNativeVersion>
<MicrosoftDotNetMaestroClientVersion>1.1.0-beta.19556.4</MicrosoftDotNetMaestroClientVersion>
<MicrosoftSourceLinkVersion>1.0.0-beta2-19554-01</MicrosoftSourceLinkVersion>
<MicrosoftDotNetSwaggerGeneratorMSBuildVersion>1.0.0-beta.20509.7</MicrosoftDotNetSwaggerGeneratorMSBuildVersion>
<MicrosoftDotNetSwaggerGeneratorMSBuildVersion>1.0.0-beta.20567.6</MicrosoftDotNetSwaggerGeneratorMSBuildVersion>
<XliffTasksVersion>1.0.0-beta.20055.1</XliffTasksVersion>

<!-- Roslyn -->
Expand Down
5 changes: 3 additions & 2 deletions eng/common/SetupNugetSources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $Passw
function EnablePrivatePackageSources($DisabledPackageSources) {
$maestroPrivateSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]")
ForEach ($DisabledPackageSource in $maestroPrivateSources) {
Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled"
$DisabledPackageSource.SetAttribute("value", "false")
Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource"
# Due to https://github.com/NuGet/Home/issues/10291, we must actually remove the disabled entries
$DisabledPackageSources.RemoveChild($DisabledPackageSource)
}
}

Expand Down
4 changes: 2 additions & 2 deletions eng/common/SetupNugetSources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ if [ "$?" == "0" ]; then
for DisabledSourceName in ${DisabledDarcIntSources[@]} ; do
if [[ $DisabledSourceName == darc-int* ]]
then
OldDisableValue="add key=\"$DisabledSourceName\" value=\"true\""
NewDisableValue="add key=\"$DisabledSourceName\" value=\"false\""
OldDisableValue="<add key=\"$DisabledSourceName\" value=\"true\" />"
NewDisableValue="<!-- Reenabled for build : $DisabledSourceName -->"
sed -i.bak "s|$OldDisableValue|$NewDisableValue|" $ConfigFile
echo "Neutralized disablePackageSources entry for '$DisabledSourceName'"
fi
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dotnet": "5.0.100-rc.1.20453.7"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.20509.7",
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.20509.7"
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.20567.6",
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.20567.6"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities
{
using System;
using System.IO;

using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces;
Expand Down Expand Up @@ -210,7 +211,29 @@ private T Deserialize<T>(JsonSerializer serializer, JToken jToken)

private JsonSerializer GetPayloadSerializer(int? version)
{
return version == 2 ? payloadSerializer2 : payloadSerializer;
if (version == null)
{
version = 1;
}

switch (version)
{
// 0 is used during negotiation
case 0:
case 1:
// Protocol version 3 was accidentally used with serializer v1 and not
// serializer v2, we downgrade to protocol 2 when 3 would be negotiated
// unless this is disabled by VSTEST_DISABLE_PROTOCOL_3_VERSION_DOWNGRADE
// env variable.
case 3:
return payloadSerializer;
case 2:
case 4:
return payloadSerializer2;
default:
throw new NotSupportedException($"Protocol version {version} is not supported. " +
"Ensure it is compatible with the latest serializer or add a new one.");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public class TestRequestSender : ITestRequestSender
// that implies host is using version 1.
private int protocolVersion = 1;

private int highestSupportedVersion = 3;
// Also check TestRequestHandler.
private int highestSupportedVersion = 4;

private TestHostConnectionInfo connectionInfo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities
public class TestRequestHandler : ITestRequestHandler
{
private int protocolVersion = 1;
private int highestSupportedVersion = 3;

// Also check TestRequestSender.
private int highestSupportedVersion = 4;

private readonly IDataSerializer dataSerializer;
private ITestHostManagerFactory testHostManagerFactory;
Expand Down Expand Up @@ -261,7 +263,36 @@ public void OnMessageReceived(object sender, MessageReceivedEventArgs messageRec
{
case MessageType.VersionCheck:
var version = this.dataSerializer.DeserializePayload<int>(message);
this.protocolVersion = Math.Min(version, highestSupportedVersion);
// choose the highest version that we both support
var negotiatedVersion = Math.Min(version, highestSupportedVersion);
// BUT don't choose 3, because protocol version 3 has performance problems in 16.7.1-16.8. Those problems are caused
// by choosing payloadSerializer instead of payloadSerializer2 for protocol version 3.
//
// We cannot just update the code to choose the new serializer, because then that change would apply only to testhost.
// Testhost is is delivered by Microsoft.NET.Test.SDK nuget package, and can be used with an older vstest.console.
// An older vstest.console, that supports protocol version 3, would serialize its messages using payloadSerializer,
// but the fixed testhost would serialize it using payloadSerializer2, resulting in incompatible messages.
//
// Instead we must downgrade to protocol version 2 when 3 would be negotiated. Or higher when higher version
// would be negotiated.
if (negotiatedVersion != 3)
{
this.protocolVersion = negotiatedVersion;
}
else
{
var flag = Environment.GetEnvironmentVariable("VSTEST_DISABLE_PROTOCOL_3_VERSION_DOWNGRADE");
var flagIsEnabled = flag != null && flag != "0";
var dowgradeIsDisabled = flagIsEnabled;
if (dowgradeIsDisabled)
{
this.protocolVersion = negotiatedVersion;
}
else
{
this.protocolVersion = 2;
}
}

// Send the negotiated protocol to request sender
this.channel.Send(this.dataSerializer.SerializePayload(MessageType.VersionCheck, this.protocolVersion));
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.TestPlatform.ObjectModel/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public static class Constants
/// <summary>
/// The default protocol version
/// </summary>
public static readonly ProtocolConfig DefaultProtocolConfig = new ProtocolConfig { Version = 3 };
public static readonly ProtocolConfig DefaultProtocolConfig = new ProtocolConfig { Version = 4 };

/// <summary>
/// The minimum protocol version that has debug support
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal class VsTestConsoleRequestSender : ITranslationLayerRequestSender

private bool handShakeSuccessful = false;

private int protocolVersion = 3;
private int protocolVersion = 4;

/// <summary>
/// Use to cancel blocking tasks associated with vstest.console process
Expand Down
2 changes: 1 addition & 1 deletion src/package/nuspec/TestPlatform.TestHost.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<file src="Microsoft.TestPlatform.TestHost\netcoreapp2.1\testhost.deps.json" target="lib\netcoreapp2.1\" />
<file src="Microsoft.TestPlatform.TestHost\netcoreapp2.1\x86\msdia140.dll" target="lib\netcoreapp2.1\x86\" />
<file src="Microsoft.TestPlatform.TestHost\netcoreapp2.1\x64\msdia140.dll" target="lib\netcoreapp2.1\x64\" />

<file src="Microsoft.TestPlatform.TestHost\netcoreapp2.1\Microsoft.TestPlatform.PlatformAbstractions.dll" target="build\netcoreapp2.1\" />
<file src="Microsoft.TestPlatform.TestHost\netcoreapp2.1\win7-x64\testhost.dll" target="build\netcoreapp2.1\x64\" />
<file src="Microsoft.TestPlatform.TestHost\netcoreapp2.1\win7-x64\testhost.exe" target="build\netcoreapp2.1\x64\" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class DesignModeClientTests

private readonly DesignModeClient designModeClient;

private readonly int protocolVersion = 3;
private readonly int protocolVersion = 4;

private readonly AutoResetEvent complateEvent;

Expand Down Expand Up @@ -131,8 +131,9 @@ public void DesignModeClientConnectShouldNotSendConnectedIfServerConnectionTimes

[TestMethod]
public void DesignModeClientDuringConnectShouldHighestCommonVersionWhenReceivedVersionIsGreaterThanSupportedVersion()
{
var verCheck = new Message { MessageType = MessageType.VersionCheck, Payload = 3 };
{

var verCheck = new Message { MessageType = MessageType.VersionCheck, Payload = 4 };
var sessionEnd = new Message { MessageType = MessageType.SessionEnd };
this.mockCommunicationManager.Setup(cm => cm.WaitForServerConnection(It.IsAny<int>())).Returns(true);
this.mockCommunicationManager.SetupSequence(cm => cm.ReceiveMessage()).Returns(verCheck).Returns(sessionEnd);
Expand Down
Loading

0 comments on commit ceebbcc

Please sign in to comment.