Skip to content

Commit

Permalink
Package upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenBond committed Oct 25, 2023
1 parent e32ed38 commit fe60bb5
Show file tree
Hide file tree
Showing 32 changed files with 456 additions and 407 deletions.
64 changes: 31 additions & 33 deletions Directory.Packages.props
Expand Up @@ -2,13 +2,10 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<!-- Shared Package Versions -->
<MicrosoftCodeAnalysisVersion>4.4.0-4.final</MicrosoftCodeAnalysisVersion>
<MicrosoftExtensionsConfigurationVersion>7.0.0</MicrosoftExtensionsConfigurationVersion>
<MicrosoftExtensionsDependencyInjectionVersion>7.0.0</MicrosoftExtensionsDependencyInjectionVersion>
<MicrosoftExtensionsLoggingVersion>7.0.0</MicrosoftExtensionsLoggingVersion>
<MicrosoftExtensionsOptionsVersion>7.0.0</MicrosoftExtensionsOptionsVersion>
<BenchmarkDotNetVersion>0.13.2</BenchmarkDotNetVersion>
<xUnitVersion>2.4.2</xUnitVersion>
<xUnitVersion>2.5.2</xUnitVersion>
<xUnitVersion Condition=" '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'netstandard2.1' ">2.4.2</xUnitVersion>
<xUnitRunnerVersion>2.5.3</xUnitRunnerVersion>
<xUnitRunnerVersion Condition=" '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'netstandard2.1' ">2.4.5</xUnitRunnerVersion>
<SourceLinkVersion>1.1.1</SourceLinkVersion>
</PropertyGroup>
<ItemGroup>
Expand All @@ -20,7 +17,7 @@
<PackageVersion Include="System.Net.NameResolution" Version="4.3.0" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0-rc.2.23479.6" />
<!-- Microsoft packages -->
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.34.0" />
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.35.4" />
<PackageVersion Include="Microsoft.Build" Version="17.7.2" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.8.0-2.final" />
Expand All @@ -38,54 +35,55 @@
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="8.0.0-rc.2.23479.6" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0-rc.2.23479.6" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0-rc.2.23479.6" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0-rc.2.23479.6" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0-rc.2.23479.6" />
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="8.0.0-rc.2.23480.2" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.0-rc.2.23479.6" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0-rc.2.23479.6" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0-rc.2.23479.6" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0-rc.2.23479.6" />
<PackageVersion Include="Azure.Data.Tables" Version="12.8.0" />
<PackageVersion Include="Azure.Core" Version="1.33.0" />
<PackageVersion Include="Azure.Messaging.EventHubs" Version="5.9.2" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.14.0" />
<PackageVersion Include="Azure.Storage.Queues" Version="12.12.0" />
<PackageVersion Include="Azure.Data.Tables" Version="12.8.1" />
<PackageVersion Include="Azure.Core" Version="1.35.0" />
<PackageVersion Include="Azure.Messaging.EventHubs" Version="5.9.3" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.18.0" />
<PackageVersion Include="Azure.Storage.Queues" Version="12.16.0" />
<!-- 3rd party packages -->
<PackageVersion Include="AWSSDK.DynamoDBv2" Version="3.7.5.16" />
<PackageVersion Include="AWSSDK.SQS" Version="3.7.2.119" />
<PackageVersion Include="Consul" Version="1.6.10.7" />
<PackageVersion Include="Google.Cloud.PubSub.V1" Version="1.0.0-beta13" />
<PackageVersion Include="Google.Protobuf" Version="3.24.1" />
<PackageVersion Include="protobuf-net" Version="3.1.22" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.2" />
<PackageVersion Include="AWSSDK.DynamoDBv2" Version="3.7.203.2" />
<PackageVersion Include="AWSSDK.SQS" Version="3.7.200.55" />
<PackageVersion Include="Consul" Version="1.6.10.9" />
<PackageVersion Include="Google.Protobuf" Version="3.24.4" />
<PackageVersion Include="protobuf-net" Version="3.2.26" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="ZooKeeperNetEx" Version="3.4.12.4" />
<PackageVersion Include="StackExchange.Redis" Version="2.6.90" />
<PackageVersion Include="KubernetesClient" Version="11.0.44" />
<PackageVersion Include="StackExchange.Redis" Version="2.6.122" />
<PackageVersion Include="KubernetesClient" Version="12.1.1" />
<!-- Test related packages -->
<PackageVersion Include="FluentAssertions" Version="6.7.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0-preview-23503-02" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.7" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.7" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.9" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.9" />
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
<PackageVersion Include="xunit" Version="2.5.3" />
<PackageVersion Include="xunit.assert" Version="2.5.3" />
<PackageVersion Include="xunit.extensibility.core" Version="2.5.3" />
<PackageVersion Include="xunit.extensibility.execution" Version="2.5.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageVersion Include="NodaTime" Version="3.1.4" />
<PackageVersion Include="xunit" Version="$(xUnitVersion)" />
<PackageVersion Include="xunit.assert" Version="$(xUnitVersion)" />
<PackageVersion Include="xunit.extensibility.core" Version="$(xUnitVersion)" />
<PackageVersion Include="xunit.extensibility.execution" Version="$(xUnitVersion)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="$(xUnitRunnerVersion)" />
<PackageVersion Include="NodaTime" Version="3.1.9" />
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="StructureMap.Microsoft.DependencyInjection" Version="2.0.0" />
<PackageVersion Include="System.CodeDom" Version="8.0.0-rc.2.23479.6" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
<PackageVersion Include="Azure.Identity" Version="1.7.0" />
<PackageVersion Include="Azure.Security.KeyVault.Secrets" Version="4.4.0" />
<PackageVersion Include="FSharp.Core" Version="7.0.0" />
<PackageVersion Include="Azure.Identity" Version="1.10.2" />
<PackageVersion Include="Azure.Security.KeyVault.Secrets" Version="4.5.0" />
<PackageVersion Include="NSubstitute" Version="4.4.0" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.15" />
<PackageVersion Include="CsCheck" Version="2.10.0" />
<PackageVersion Include="System.Data.SqlClient" Version="4.8.5" />
<PackageVersion Include="Npgsql" Version="6.0.7" />
<PackageVersion Include="MySql.Data" Version="8.0.31" />
<PackageVersion Include="MySql.Data" Version="8.1.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.24" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
<PackageVersion Include="Microsoft.Crank.EventSources" Version="0.2.0-alpha.23422.5" />
Expand All @@ -94,7 +92,7 @@
<PackageVersion Include="Utf8Json" Version="1.3.7" />
<PackageVersion Include="SpanJson" Version="4.0.1" />
<PackageVersion Include="Hyperion" Version="0.12.2" />
<PackageVersion Include="Grpc.Tools" Version="2.57.0" />
<PackageVersion Include="Grpc.Tools" Version="2.58.0" />
<!-- Tooling related packages -->
<PackageVersion Include="Microsoft.SourceLink.AzureRepos.Git" Version="$(SourceLinkVersion)" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="$(SourceLinkVersion)" />
Expand Down
5 changes: 4 additions & 1 deletion test/Benchmarks/Benchmarks.csproj
Expand Up @@ -28,7 +28,10 @@
<PackageReference Include="SpanJson" />
<PackageReference Include="Hyperion" />
<PackageReference Include="Google.Protobuf" />
<PackageReference Include="Grpc.Tools" />
<PackageReference Include="Grpc.Tools">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
64 changes: 39 additions & 25 deletions test/DefaultCluster.Tests/BasicActivationTests.cs
@@ -1,11 +1,10 @@
using System.Globalization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using TestExtensions;
using UnitTests.GrainInterfaces;
using Xunit;

#pragma warning disable 618

namespace DefaultCluster.Tests.General
{
public class BasicActivationTests : HostedTestClusterEnsureDefaultStarted
Expand All @@ -14,6 +13,9 @@ public BasicActivationTests(DefaultClusterFixture fixture) : base(fixture)
{
}

private TimeSpan GetResponseTimeout() => this.Client.ServiceProvider.GetRequiredService<OutsideRuntimeClient>().GetResponseTimeout();
private void SetResponseTimeout(TimeSpan value) => this.Client.ServiceProvider.GetRequiredService<OutsideRuntimeClient>().SetResponseTimeout(value);

[Fact, TestCategory("BVT"), TestCategory("ActivateDeactivate"), TestCategory("GetGrain")]
public async Task BasicActivation_ActivateAndUpdate()
{
Expand Down Expand Up @@ -209,32 +211,46 @@ public async Task BasicActivation_MultipleGrainInterfaces()
public async Task BasicActivation_Reentrant_RecoveryAfterExpiredMessage()
{
List<Task> promises = new List<Task>();
TimeSpan timeout = TimeSpan.FromMilliseconds(1000);

ITestGrain grain = this.GrainFactory.GetGrain<ITestGrain>(GetRandomGrainId());
int num = 10;
for (long i = 0; i < num; i++)
{
Task task = grain.DoLongAction(
TimeSpan.FromMilliseconds(timeout.TotalMilliseconds * 3),
"A_" + i);
promises.Add(task);
}
TimeSpan prevTimeout = this.GetResponseTimeout();
try
{
await Task.WhenAll(promises);
// set short response time and ask to do long operation, to trigger expired msgs in the silo queues.
TimeSpan shortTimeout = TimeSpan.FromMilliseconds(1000);
this.SetResponseTimeout(shortTimeout);

ITestGrain grain = this.GrainFactory.GetGrain<ITestGrain>(GetRandomGrainId());
int num = 10;
for (long i = 0; i < num; i++)
{
Task task = grain.DoLongAction(
TimeSpan.FromMilliseconds(shortTimeout.TotalMilliseconds * 3),
"A_" + i);
promises.Add(task);
}
try
{
await Task.WhenAll(promises);
}
catch (Exception)
{
this.Logger.LogInformation("Done with stress iteration.");
}

// wait a bit to make sure expired msgs in the silo is trigered.
Thread.Sleep(TimeSpan.FromSeconds(10));

// set the regular response time back, expect msgs ot succeed.
this.SetResponseTimeout(prevTimeout);

this.Logger.LogInformation("About to send a next legit request that should succeed.");
await grain.DoLongAction(TimeSpan.FromMilliseconds(1), "B_" + 0);
this.Logger.LogInformation("The request succeeded.");
}
catch (Exception)
finally
{
this.Logger.LogInformation("Done with stress iteration.");
// set the regular response time back, expect msgs ot succeed.
this.SetResponseTimeout(prevTimeout);
}

// wait a bit to make sure expired msgs in the silo is trigered.
await Task.Delay(TimeSpan.FromSeconds(10));

this.Logger.LogInformation("About to send a next legit request that should succeed.");
await grain.DoLongAction(TimeSpan.FromMilliseconds(1), "B_" + 0);
this.Logger.LogInformation("The request succeeded.");
}

[Fact, TestCategory("BVT"), TestCategory("RequestContext"), TestCategory("GetGrain")]
Expand All @@ -249,5 +265,3 @@ public async Task BasicActivation_TestRequestContext()
}
}
}

#pragma warning restore 618
4 changes: 2 additions & 2 deletions test/DefaultCluster.Tests/CodeGenTests/GeneratorGrainTest.cs
Expand Up @@ -210,8 +210,8 @@ public async Task GrainObserverWithGenericMethods()
public async Task GrainWithValueTaskMethod()
{
var grain = this.GrainFactory.GetGrain<IGrainWithGenericMethods>(Guid.NewGuid());
Assert.Equal(1, await grain.ValueTaskMethod(true).ConfigureAwait(false));
Assert.Equal(2, await grain.ValueTaskMethod(false).ConfigureAwait(false));
Assert.Equal(1, await grain.ValueTaskMethod(true));
Assert.Equal(2, await grain.ValueTaskMethod(false));
}

private class ObserverWithGenericMethods : IGrainObserverWithGenericMethods
Expand Down
25 changes: 13 additions & 12 deletions test/DefaultCluster.Tests/EchoTaskGrainTests.cs
Expand Up @@ -124,22 +124,23 @@ public async Task EchoGrain_Timeout_Result()
TimeSpan delay25 = TimeSpan.FromSeconds(25);
Stopwatch sw = new Stopwatch();
sw.Start();
await Task.Run(() =>
try
{
try
// Note that this method purposely uses Task.Result.
int res = await Task.Run(() =>
{
// Note that this method purposely uses Task.Result.
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
var res = grain.BlockingCallTimeoutAsync(delay25).Result;
return grain.BlockingCallTimeoutAsync(delay25).Result;
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method
Assert.Fail($"BlockingCallTimeout should not have completed successfully, but returned {res}");
}
catch (Exception exc)
{
while (exc is AggregateException) exc = exc.InnerException;
Assert.IsAssignableFrom<TimeoutException>(exc);
}
});
});

Assert.Fail($"BlockingCallTimeout should not have completed successfully, but returned {res}");
}
catch (Exception exc)
{
while (exc is AggregateException) exc = exc.InnerException;
Assert.IsAssignableFrom<TimeoutException>(exc);
}
sw.Stop();
Assert.True(TimeIsLonger(sw.Elapsed, delay5), $"Elapsed time out of range: {sw.Elapsed}");
Assert.True(TimeIsShorter(sw.Elapsed, delay25), $"Elapsed time out of range: {sw.Elapsed}");
Expand Down

0 comments on commit fe60bb5

Please sign in to comment.