From 64f6a0958a9d832ce93a560c22b28fb8489cd720 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 13 Jun 2024 11:05:43 +0800 Subject: [PATCH] Update repo for .NET 9 (#2457) --- .github/workflows/test.yml | 7 +++++++ Directory.Build.props | 3 +++ Directory.Packages.props | 9 +++++---- build/get-dotnet.sh | 13 +++++-------- build_and_test.sh | 13 ++++++------- examples/Aggregator/Client/Client.csproj | 2 +- examples/Aggregator/Server/Server.csproj | 2 +- examples/Blazor/Client/Client.csproj | 2 +- examples/Blazor/Server/Server.csproj | 2 +- examples/Browser/Server/Server.csproj | 2 +- examples/Certifier/Client/Client.csproj | 2 +- examples/Certifier/Server/Server.csproj | 2 +- examples/Channeler/Client/Client.csproj | 2 +- examples/Channeler/Server/Server.csproj | 2 +- examples/Coder/Client/Client.csproj | 2 +- examples/Coder/Server/Server.csproj | 2 +- examples/Compressor/Client/Client.csproj | 2 +- examples/Compressor/Server/Server.csproj | 2 +- examples/Container/Backend/Backend.csproj | 2 +- examples/Container/Backend/Dockerfile | 4 ++-- examples/Container/Frontend/Dockerfile | 4 ++-- examples/Container/Frontend/Frontend.csproj | 2 +- examples/Counter/Client/Client.csproj | 2 +- examples/Counter/Server/Server.csproj | 2 +- examples/Downloader/Client/Client.csproj | 2 +- examples/Downloader/Server/Server.csproj | 2 +- examples/Error/Client/Client.csproj | 2 +- examples/Error/Server/Server.csproj | 2 +- examples/Frameworker/Server/Server.csproj | 2 +- examples/Greeter/Client/Client.csproj | 2 +- examples/Greeter/Server/Server.csproj | 2 +- examples/Interceptor/Client/Client.csproj | 2 +- examples/Interceptor/Server/Server.csproj | 2 +- examples/Liber/Client/Client.csproj | 2 +- examples/Liber/Server/Server.csproj | 2 +- examples/Locator/Client/Client.csproj | 2 +- examples/Locator/Server/Server.csproj | 2 +- examples/Mailer/Client/Client.csproj | 2 +- examples/Mailer/Server/Server.csproj | 2 +- examples/Progressor/Client/Client.csproj | 2 +- examples/Progressor/Server/Server.csproj | 2 +- examples/Racer/Client/Client.csproj | 2 +- examples/Racer/Server/Server.csproj | 2 +- examples/Reflector/Client/Client.csproj | 2 +- examples/Reflector/Server/Server.csproj | 2 +- examples/Retrier/Client/Client.csproj | 2 +- examples/Retrier/Server/Server.csproj | 2 +- examples/Spar/Server/Server.csproj | 2 +- examples/Tester/Client/Client.csproj | 2 +- examples/Tester/Server/Server.csproj | 2 +- examples/Tester/Tests/Tests.csproj | 2 +- examples/Ticketer/Client/Client.csproj | 2 +- examples/Ticketer/Server/Server.csproj | 2 +- examples/Transcoder/Server/Server.csproj | 2 +- examples/Transporter/Client/Client.csproj | 2 +- examples/Transporter/Server/Server.csproj | 2 +- examples/Uploader/Client/Client.csproj | 2 +- examples/Uploader/Server/Server.csproj | 2 +- examples/Vigor/Client/Client.csproj | 2 +- examples/Vigor/Server/Server.csproj | 2 +- examples/Worker/Client/Client.csproj | 2 +- examples/Worker/Server/Server.csproj | 2 +- global.json | 2 +- .../Client/CompressedUnaryClientBenchmark.cs | 4 ++-- .../Grpc.AspNetCore.Microbenchmarks.csproj | 2 +- .../CompressedUnaryServerCallHandlerBenchmark.cs | 4 ++-- .../GrpcAspNetCoreServer.csproj | 7 +------ perf/benchmarkapps/GrpcClient/GrpcClient.csproj | 7 +------ .../GrpcCoreServer/GrpcCoreServer.csproj | 6 ++---- perf/benchmarkapps/QpsWorker/QpsWorker.csproj | 2 +- .../Grpc.AspNetCore.HealthChecks.csproj | 2 +- .../Grpc.AspNetCore.Server.ClientFactory.csproj | 2 +- .../Grpc.AspNetCore.Server.Reflection.csproj | 2 +- .../Grpc.AspNetCore.Server.csproj | 2 +- .../Internal/HttpContextServerCallContext.cs | 2 +- .../Grpc.AspNetCore.Web.csproj | 2 +- src/Grpc.AspNetCore/Grpc.AspNetCore.csproj | 2 +- src/Grpc.AspNetCore/lib/net9.0/_._ | 0 src/Grpc.Net.Client/Balancer/PollingResolver.cs | 14 ++++++++++++-- .../FunctionalTests/Balancer/DnsResolverTests.cs | 16 ++++++++++------ .../Grpc.AspNetCore.FunctionalTests.csproj | 12 +++++------- .../Infrastructure/GrpcTestFixture.cs | 12 ++++++++++-- test/FunctionalTests/Linker/LinkerTests.cs | 4 ++-- ....AspNetCore.Server.ClientFactory.Tests.csproj | 2 +- .../Grpc.AspNetCore.Server.Tests.csproj | 2 +- .../Balancer/ConnectionManagerTests.cs | 9 +++++++++ .../Balancer/PickFirstBalancerTests.cs | 9 +++++++-- .../Grpc.Net.Client.Tests.csproj | 4 ++-- .../Grpc.Net.Client.Web.Tests.csproj | 2 +- .../Grpc.Net.ClientFactory.Tests.csproj | 2 +- .../Grpc.StatusProto.Tests.csproj | 2 +- test/dotnet-grpc.Tests/dotnet-grpc.Tests.csproj | 2 +- .../BenchmarkWorkerWebsite.csproj | 4 ++-- .../FunctionalTestsWebsite.csproj | 2 +- .../InteropTestsClient/InteropTestsClient.csproj | 9 ++------- .../InteropTestsGrpcWebClient.csproj | 2 +- testassets/InteropTestsGrpcWebWebsite/Dockerfile | 4 ++-- .../InteropTestsGrpcWebWebsite.csproj | 2 +- .../InteropTestsNativeServer.csproj | 2 +- testassets/InteropTestsWebsite/Dockerfile | 6 +++--- .../InteropTestsWebsite.csproj | 4 ++-- .../LinkerTestsClient/LinkerTestsClient.csproj | 2 +- .../LinkerTestsWebsite/LinkerTestsWebsite.csproj | 2 +- 103 files changed, 183 insertions(+), 159 deletions(-) create mode 100644 src/Grpc.AspNetCore/lib/net9.0/_._ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b81eb1905..8dace7b8f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,13 @@ jobs: - name: Build and run tests run: ./build_and_test.sh + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: artifacts + path: artifacts + if-no-files-found: error grpc_web: name: gRPC-Web Tests diff --git a/Directory.Build.props b/Directory.Build.props index dfaecc5d9..d60c28751 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -24,6 +24,9 @@ 12.0 enable enable + + + true diff --git a/Directory.Packages.props b/Directory.Packages.props index 55c8a1d1b..6b236e040 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,14 +1,15 @@ true - 8.0.0 + 9.0.0-preview.5.24306.11 + 8.0.6 7.0.5 6.0.11 - 2.58.0 + 2.63.0 1.6.0 1.8.1 1.8.0-beta.1 - 8.0.0 + 9.0.0-preview.5.24306.7 6.0.0 @@ -64,7 +65,7 @@ - + diff --git a/build/get-dotnet.sh b/build/get-dotnet.sh index 05616b74d..30b8e6571 100755 --- a/build/get-dotnet.sh +++ b/build/get-dotnet.sh @@ -27,17 +27,14 @@ echo "Downloading install script: $install_script_url => $install_script_path" curl -sSL -o $install_script_path $install_script_url chmod +x $install_script_path -# Install .NET Core 3.x SDK to run 3.x test targets -$install_script_path -v 3.1.300 -i $dotnet_install_path - -# Install .NET 5 SDK to run 5.0 test targets -$install_script_path -v 5.0.302 -i $dotnet_install_path - # Install .NET 6 SDK to run 6.0 test targets -$install_script_path -v 6.0.202 -i $dotnet_install_path +$install_script_path -v 6.0.423 -i $dotnet_install_path # Install .NET 7 SDK to run 7.0 test targets -$install_script_path -v 7.0.100 -i $dotnet_install_path +$install_script_path -v 7.0.410 -i $dotnet_install_path + +# Install .NET 8 SDK to run 8.0 test targets +$install_script_path -v 8.0.301 -i $dotnet_install_path # Install .NET version specified by global.json $install_script_path -v $sdk_version -i $dotnet_install_path diff --git a/build_and_test.sh b/build_and_test.sh index 9fa9ec12f..638d71347 100755 --- a/build_and_test.sh +++ b/build_and_test.sh @@ -22,22 +22,21 @@ echo "Building solution" dotnet build -c Release echo "Building examples" - example_solutions=( $( ls examples/**/*.sln ) ) - for example_solution in "${example_solutions[@]}" do dotnet build $example_solution -c Release done echo "Testing solution" - +has_failures=false test_projects=( $( ls test/**/*Tests.csproj ) ) - for test_project in "${test_projects[@]}" do - # https://github.com/microsoft/vstest/issues/2080#issuecomment-539879345 - dotnet test $test_project -c Release -v n --no-build -- NUnit.ConsoleOut=0 < /dev/null + base_name=$(basename ${test_project%.*}) + dotnet test $test_project -c Release --no-build --logger "trx;LogFilePrefix=$base_name" --results-directory artifacts/test-results -- NUnit.ConsoleOut=0 || has_failures=true done -echo "Tests finished" \ No newline at end of file +if [ "$has_failures" = true ]; then + exit 1 +fi \ No newline at end of file diff --git a/examples/Aggregator/Client/Client.csproj b/examples/Aggregator/Client/Client.csproj index 9766a3ba9..3d1b72315 100644 --- a/examples/Aggregator/Client/Client.csproj +++ b/examples/Aggregator/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Aggregator/Server/Server.csproj b/examples/Aggregator/Server/Server.csproj index 2d90e0ffb..14e32a4da 100644 --- a/examples/Aggregator/Server/Server.csproj +++ b/examples/Aggregator/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Blazor/Client/Client.csproj b/examples/Blazor/Client/Client.csproj index b035bfcde..80fa209bb 100644 --- a/examples/Blazor/Client/Client.csproj +++ b/examples/Blazor/Client/Client.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Blazor/Server/Server.csproj b/examples/Blazor/Server/Server.csproj index a9ead59e4..6823cf0d8 100644 --- a/examples/Blazor/Server/Server.csproj +++ b/examples/Blazor/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 46982f83-f153-443e-b589-4b2bc7b5945e diff --git a/examples/Browser/Server/Server.csproj b/examples/Browser/Server/Server.csproj index e0de0c89f..e3a9dfcfb 100644 --- a/examples/Browser/Server/Server.csproj +++ b/examples/Browser/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 wwwroot\ $(DefaultItemExcludes);$(SpaRoot)node_modules\**;$(SpaRoot)dist\** diff --git a/examples/Certifier/Client/Client.csproj b/examples/Certifier/Client/Client.csproj index 305a3ffec..3d14ea270 100644 --- a/examples/Certifier/Client/Client.csproj +++ b/examples/Certifier/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Certifier/Server/Server.csproj b/examples/Certifier/Server/Server.csproj index 21dd2d465..febaea474 100644 --- a/examples/Certifier/Server/Server.csproj +++ b/examples/Certifier/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Channeler/Client/Client.csproj b/examples/Channeler/Client/Client.csproj index baf93058a..ccfa0547c 100644 --- a/examples/Channeler/Client/Client.csproj +++ b/examples/Channeler/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Channeler/Server/Server.csproj b/examples/Channeler/Server/Server.csproj index 01a0f54ee..ec6d11829 100644 --- a/examples/Channeler/Server/Server.csproj +++ b/examples/Channeler/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Coder/Client/Client.csproj b/examples/Coder/Client/Client.csproj index c0f322c33..6df630519 100644 --- a/examples/Coder/Client/Client.csproj +++ b/examples/Coder/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Coder/Server/Server.csproj b/examples/Coder/Server/Server.csproj index 5ff1ffe54..af3ca08a4 100644 --- a/examples/Coder/Server/Server.csproj +++ b/examples/Coder/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Compressor/Client/Client.csproj b/examples/Compressor/Client/Client.csproj index 8e1210c5b..9a6d99f41 100644 --- a/examples/Compressor/Client/Client.csproj +++ b/examples/Compressor/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Compressor/Server/Server.csproj b/examples/Compressor/Server/Server.csproj index 680f20ede..fc2b70b5b 100644 --- a/examples/Compressor/Server/Server.csproj +++ b/examples/Compressor/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Container/Backend/Backend.csproj b/examples/Container/Backend/Backend.csproj index fcea85f43..99ea5072f 100644 --- a/examples/Container/Backend/Backend.csproj +++ b/examples/Container/Backend/Backend.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Container/Backend/Dockerfile b/examples/Container/Backend/Dockerfile index 6f9d6ccfd..78b8007d5 100644 --- a/examples/Container/Backend/Dockerfile +++ b/examples/Container/Backend/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/nightly/sdk:9.0-preview AS build-env WORKDIR /app # Copy everything @@ -8,7 +8,7 @@ RUN dotnet restore examples/Container/Backend RUN dotnet publish examples/Container/Backend -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/nightly/aspnet:9.0-preview WORKDIR /app COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "Backend.dll"] \ No newline at end of file diff --git a/examples/Container/Frontend/Dockerfile b/examples/Container/Frontend/Dockerfile index 4acbb839b..23403110c 100644 --- a/examples/Container/Frontend/Dockerfile +++ b/examples/Container/Frontend/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/nightly/sdk:9.0-preview AS build-env WORKDIR /app # Copy everything @@ -8,7 +8,7 @@ RUN dotnet restore examples/Container/Frontend RUN dotnet publish examples/Container/Frontend -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/nightly/aspnet:9.0-preview WORKDIR /app COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "Frontend.dll"] \ No newline at end of file diff --git a/examples/Container/Frontend/Frontend.csproj b/examples/Container/Frontend/Frontend.csproj index 20b98a480..cd0fc7b99 100644 --- a/examples/Container/Frontend/Frontend.csproj +++ b/examples/Container/Frontend/Frontend.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Counter/Client/Client.csproj b/examples/Counter/Client/Client.csproj index 107cacb53..4ad92fb9d 100644 --- a/examples/Counter/Client/Client.csproj +++ b/examples/Counter/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Counter/Server/Server.csproj b/examples/Counter/Server/Server.csproj index 31b325a93..dd710e141 100644 --- a/examples/Counter/Server/Server.csproj +++ b/examples/Counter/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Downloader/Client/Client.csproj b/examples/Downloader/Client/Client.csproj index db9574e88..c09a84092 100644 --- a/examples/Downloader/Client/Client.csproj +++ b/examples/Downloader/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Downloader/Server/Server.csproj b/examples/Downloader/Server/Server.csproj index 18b2d741c..f34da753d 100644 --- a/examples/Downloader/Server/Server.csproj +++ b/examples/Downloader/Server/Server.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 diff --git a/examples/Error/Client/Client.csproj b/examples/Error/Client/Client.csproj index 7ff15b352..90dd30d2d 100644 --- a/examples/Error/Client/Client.csproj +++ b/examples/Error/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Error/Server/Server.csproj b/examples/Error/Server/Server.csproj index d7abe248b..4544e2b24 100644 --- a/examples/Error/Server/Server.csproj +++ b/examples/Error/Server/Server.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 diff --git a/examples/Frameworker/Server/Server.csproj b/examples/Frameworker/Server/Server.csproj index 680f20ede..fc2b70b5b 100644 --- a/examples/Frameworker/Server/Server.csproj +++ b/examples/Frameworker/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Greeter/Client/Client.csproj b/examples/Greeter/Client/Client.csproj index 8e1210c5b..9a6d99f41 100644 --- a/examples/Greeter/Client/Client.csproj +++ b/examples/Greeter/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Greeter/Server/Server.csproj b/examples/Greeter/Server/Server.csproj index 680f20ede..fc2b70b5b 100644 --- a/examples/Greeter/Server/Server.csproj +++ b/examples/Greeter/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Interceptor/Client/Client.csproj b/examples/Interceptor/Client/Client.csproj index 472ada4fd..64dacdbc3 100644 --- a/examples/Interceptor/Client/Client.csproj +++ b/examples/Interceptor/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Interceptor/Server/Server.csproj b/examples/Interceptor/Server/Server.csproj index 680f20ede..fc2b70b5b 100644 --- a/examples/Interceptor/Server/Server.csproj +++ b/examples/Interceptor/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Liber/Client/Client.csproj b/examples/Liber/Client/Client.csproj index 9f1e8dc8f..c8d8a79ec 100644 --- a/examples/Liber/Client/Client.csproj +++ b/examples/Liber/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Liber/Server/Server.csproj b/examples/Liber/Server/Server.csproj index 2d35cfd27..5be6023d3 100644 --- a/examples/Liber/Server/Server.csproj +++ b/examples/Liber/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Locator/Client/Client.csproj b/examples/Locator/Client/Client.csproj index e5ef1144e..1922a9935 100644 --- a/examples/Locator/Client/Client.csproj +++ b/examples/Locator/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Locator/Server/Server.csproj b/examples/Locator/Server/Server.csproj index 449017aa1..f17ea3c6f 100644 --- a/examples/Locator/Server/Server.csproj +++ b/examples/Locator/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Mailer/Client/Client.csproj b/examples/Mailer/Client/Client.csproj index 170d78b8f..4514682cb 100644 --- a/examples/Mailer/Client/Client.csproj +++ b/examples/Mailer/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Mailer/Server/Server.csproj b/examples/Mailer/Server/Server.csproj index 1309342ae..4236ef3b2 100644 --- a/examples/Mailer/Server/Server.csproj +++ b/examples/Mailer/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Progressor/Client/Client.csproj b/examples/Progressor/Client/Client.csproj index 632226100..32247ad3a 100644 --- a/examples/Progressor/Client/Client.csproj +++ b/examples/Progressor/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Progressor/Server/Server.csproj b/examples/Progressor/Server/Server.csproj index 2da2c884e..c7bf517a2 100644 --- a/examples/Progressor/Server/Server.csproj +++ b/examples/Progressor/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Racer/Client/Client.csproj b/examples/Racer/Client/Client.csproj index 90db58512..981f718ae 100644 --- a/examples/Racer/Client/Client.csproj +++ b/examples/Racer/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Racer/Server/Server.csproj b/examples/Racer/Server/Server.csproj index 59f5c52aa..6dd7f56cd 100644 --- a/examples/Racer/Server/Server.csproj +++ b/examples/Racer/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Reflector/Client/Client.csproj b/examples/Reflector/Client/Client.csproj index 4e1ac31a2..ee1105f64 100644 --- a/examples/Reflector/Client/Client.csproj +++ b/examples/Reflector/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Reflector/Server/Server.csproj b/examples/Reflector/Server/Server.csproj index e24a3b947..58b48987c 100644 --- a/examples/Reflector/Server/Server.csproj +++ b/examples/Reflector/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Retrier/Client/Client.csproj b/examples/Retrier/Client/Client.csproj index 046507e85..0535a79a2 100644 --- a/examples/Retrier/Client/Client.csproj +++ b/examples/Retrier/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Retrier/Server/Server.csproj b/examples/Retrier/Server/Server.csproj index 67ba04a00..9ebaefee7 100644 --- a/examples/Retrier/Server/Server.csproj +++ b/examples/Retrier/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Spar/Server/Server.csproj b/examples/Spar/Server/Server.csproj index a32b09140..9682c7811 100644 --- a/examples/Spar/Server/Server.csproj +++ b/examples/Spar/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 ClientApp\ $(SpaRoot)node_modules\**;$(SpaRoot)dist\**;$(DefaultItemExcludes) true diff --git a/examples/Tester/Client/Client.csproj b/examples/Tester/Client/Client.csproj index 7e43e143b..da9910e40 100644 --- a/examples/Tester/Client/Client.csproj +++ b/examples/Tester/Client/Client.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 dotnet-Client-33BD397C-6A11-40D0-AF85-24B9610F7517 diff --git a/examples/Tester/Server/Server.csproj b/examples/Tester/Server/Server.csproj index fb4baa57e..266d8597f 100644 --- a/examples/Tester/Server/Server.csproj +++ b/examples/Tester/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Tester/Tests/Tests.csproj b/examples/Tester/Tests/Tests.csproj index d84a0288d..5859b2fb4 100644 --- a/examples/Tester/Tests/Tests.csproj +++ b/examples/Tester/Tests/Tests.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Ticketer/Client/Client.csproj b/examples/Ticketer/Client/Client.csproj index ddfba064c..aa0e18841 100644 --- a/examples/Ticketer/Client/Client.csproj +++ b/examples/Ticketer/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Ticketer/Server/Server.csproj b/examples/Ticketer/Server/Server.csproj index 7dbccdcbe..52e46dea4 100644 --- a/examples/Ticketer/Server/Server.csproj +++ b/examples/Ticketer/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Transcoder/Server/Server.csproj b/examples/Transcoder/Server/Server.csproj index 79ccd89ff..0d0f2eb3e 100644 --- a/examples/Transcoder/Server/Server.csproj +++ b/examples/Transcoder/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 true $(NoWarn);1591 diff --git a/examples/Transporter/Client/Client.csproj b/examples/Transporter/Client/Client.csproj index 7252a42eb..672f25b07 100644 --- a/examples/Transporter/Client/Client.csproj +++ b/examples/Transporter/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Transporter/Server/Server.csproj b/examples/Transporter/Server/Server.csproj index 680f20ede..fc2b70b5b 100644 --- a/examples/Transporter/Server/Server.csproj +++ b/examples/Transporter/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Uploader/Client/Client.csproj b/examples/Uploader/Client/Client.csproj index b25c76e98..7b7d15087 100644 --- a/examples/Uploader/Client/Client.csproj +++ b/examples/Uploader/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Uploader/Server/Server.csproj b/examples/Uploader/Server/Server.csproj index 3ee3e6d55..bf8165e50 100644 --- a/examples/Uploader/Server/Server.csproj +++ b/examples/Uploader/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Vigor/Client/Client.csproj b/examples/Vigor/Client/Client.csproj index 099181b74..e77948dc6 100644 --- a/examples/Vigor/Client/Client.csproj +++ b/examples/Vigor/Client/Client.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/examples/Vigor/Server/Server.csproj b/examples/Vigor/Server/Server.csproj index 81518c4ca..60cc7e312 100644 --- a/examples/Vigor/Server/Server.csproj +++ b/examples/Vigor/Server/Server.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/examples/Worker/Client/Client.csproj b/examples/Worker/Client/Client.csproj index 0166c8625..ede4044ae 100644 --- a/examples/Worker/Client/Client.csproj +++ b/examples/Worker/Client/Client.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 dotnet-Client-33BD397C-6A11-40D0-AF85-24B9610F7517 diff --git a/examples/Worker/Server/Server.csproj b/examples/Worker/Server/Server.csproj index 0307d536f..83e22cf3f 100644 --- a/examples/Worker/Server/Server.csproj +++ b/examples/Worker/Server/Server.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 diff --git a/global.json b/global.json index a2a860ac2..334b825de 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.200", + "version": "9.0.100-preview.5.24305.3", "rollForward": "latestFeature" } } diff --git a/perf/Grpc.AspNetCore.Microbenchmarks/Client/CompressedUnaryClientBenchmark.cs b/perf/Grpc.AspNetCore.Microbenchmarks/Client/CompressedUnaryClientBenchmark.cs index 0a1196b1a..ee39e822e 100644 --- a/perf/Grpc.AspNetCore.Microbenchmarks/Client/CompressedUnaryClientBenchmark.cs +++ b/perf/Grpc.AspNetCore.Microbenchmarks/Client/CompressedUnaryClientBenchmark.cs @@ -1,4 +1,4 @@ -#region Copyright notice and license +#region Copyright notice and license // Copyright 2019 The gRPC Authors // @@ -47,7 +47,7 @@ public CompressedUnaryClientBenchmark() protected override byte[] GetMessageData(HelloReply message) { var httpContext = new DefaultHttpContext(); - httpContext.Request.Headers.Add(GrpcProtocolConstants.MessageAcceptEncodingHeader, TestCompressionProvider.Name); + httpContext.Request.Headers.Append(GrpcProtocolConstants.MessageAcceptEncodingHeader, TestCompressionProvider.Name); var callContext = HttpContextServerCallContextHelper.CreateServerCallContext( httpContext, diff --git a/perf/Grpc.AspNetCore.Microbenchmarks/Grpc.AspNetCore.Microbenchmarks.csproj b/perf/Grpc.AspNetCore.Microbenchmarks/Grpc.AspNetCore.Microbenchmarks.csproj index 45b95f9f0..d4107b395 100644 --- a/perf/Grpc.AspNetCore.Microbenchmarks/Grpc.AspNetCore.Microbenchmarks.csproj +++ b/perf/Grpc.AspNetCore.Microbenchmarks/Grpc.AspNetCore.Microbenchmarks.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net9.0 diff --git a/perf/Grpc.AspNetCore.Microbenchmarks/Server/CompressedUnaryServerCallHandlerBenchmark.cs b/perf/Grpc.AspNetCore.Microbenchmarks/Server/CompressedUnaryServerCallHandlerBenchmark.cs index 9e4aea0ff..bd40ac750 100644 --- a/perf/Grpc.AspNetCore.Microbenchmarks/Server/CompressedUnaryServerCallHandlerBenchmark.cs +++ b/perf/Grpc.AspNetCore.Microbenchmarks/Server/CompressedUnaryServerCallHandlerBenchmark.cs @@ -1,4 +1,4 @@ -#region Copyright notice and license +#region Copyright notice and license // Copyright 2019 The gRPC Authors // @@ -46,7 +46,7 @@ protected override void SetupHttpContext(HttpContext httpContext) protected override byte[] GetMessageData(ChatMessage message) { var httpContext = new DefaultHttpContext(); - httpContext.Request.Headers.Add(GrpcProtocolConstants.MessageAcceptEncodingHeader, TestCompressionProvider.Name); + httpContext.Request.Headers.Append(GrpcProtocolConstants.MessageAcceptEncodingHeader, TestCompressionProvider.Name); var callContext = HttpContextServerCallContextHelper.CreateServerCallContext( httpContext, diff --git a/perf/benchmarkapps/GrpcAspNetCoreServer/GrpcAspNetCoreServer.csproj b/perf/benchmarkapps/GrpcAspNetCoreServer/GrpcAspNetCoreServer.csproj index 1577f2652..0489c6031 100644 --- a/perf/benchmarkapps/GrpcAspNetCoreServer/GrpcAspNetCoreServer.csproj +++ b/perf/benchmarkapps/GrpcAspNetCoreServer/GrpcAspNetCoreServer.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Exe $(DefineConstants);GRPC_WEB @@ -13,14 +13,9 @@ True - - $(NoWarn);CS8981 - - - diff --git a/perf/benchmarkapps/GrpcClient/GrpcClient.csproj b/perf/benchmarkapps/GrpcClient/GrpcClient.csproj index 2883361de..e8b6f2125 100644 --- a/perf/benchmarkapps/GrpcClient/GrpcClient.csproj +++ b/perf/benchmarkapps/GrpcClient/GrpcClient.csproj @@ -1,19 +1,14 @@  - net8.0 + net9.0 Exe $(DefineConstants);GRPC_WEB true - - $(NoWarn);CS8981 - - - diff --git a/perf/benchmarkapps/GrpcCoreServer/GrpcCoreServer.csproj b/perf/benchmarkapps/GrpcCoreServer/GrpcCoreServer.csproj index 4a9ec3872..2db58d328 100644 --- a/perf/benchmarkapps/GrpcCoreServer/GrpcCoreServer.csproj +++ b/perf/benchmarkapps/GrpcCoreServer/GrpcCoreServer.csproj @@ -1,10 +1,8 @@ - + - net7.0 + net9.0 Exe - - $(NoWarn);CS8981 diff --git a/perf/benchmarkapps/QpsWorker/QpsWorker.csproj b/perf/benchmarkapps/QpsWorker/QpsWorker.csproj index 53026e188..fbdb88186 100644 --- a/perf/benchmarkapps/QpsWorker/QpsWorker.csproj +++ b/perf/benchmarkapps/QpsWorker/QpsWorker.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable diff --git a/src/Grpc.AspNetCore.HealthChecks/Grpc.AspNetCore.HealthChecks.csproj b/src/Grpc.AspNetCore.HealthChecks/Grpc.AspNetCore.HealthChecks.csproj index 191d62181..ea485f312 100644 --- a/src/Grpc.AspNetCore.HealthChecks/Grpc.AspNetCore.HealthChecks.csproj +++ b/src/Grpc.AspNetCore.HealthChecks/Grpc.AspNetCore.HealthChecks.csproj @@ -6,7 +6,7 @@ true true - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 $(WarningsNotAsErrors);CA2007 diff --git a/src/Grpc.AspNetCore.Server.ClientFactory/Grpc.AspNetCore.Server.ClientFactory.csproj b/src/Grpc.AspNetCore.Server.ClientFactory/Grpc.AspNetCore.Server.ClientFactory.csproj index f67ca4d36..e41360758 100644 --- a/src/Grpc.AspNetCore.Server.ClientFactory/Grpc.AspNetCore.Server.ClientFactory.csproj +++ b/src/Grpc.AspNetCore.Server.ClientFactory/Grpc.AspNetCore.Server.ClientFactory.csproj @@ -6,7 +6,7 @@ true true - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 $(WarningsNotAsErrors);CA2007 diff --git a/src/Grpc.AspNetCore.Server.Reflection/Grpc.AspNetCore.Server.Reflection.csproj b/src/Grpc.AspNetCore.Server.Reflection/Grpc.AspNetCore.Server.Reflection.csproj index d74e86d4b..41aa22c11 100644 --- a/src/Grpc.AspNetCore.Server.Reflection/Grpc.AspNetCore.Server.Reflection.csproj +++ b/src/Grpc.AspNetCore.Server.Reflection/Grpc.AspNetCore.Server.Reflection.csproj @@ -6,7 +6,7 @@ true true - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 $(WarningsNotAsErrors);CA2007 diff --git a/src/Grpc.AspNetCore.Server/Grpc.AspNetCore.Server.csproj b/src/Grpc.AspNetCore.Server/Grpc.AspNetCore.Server.csproj index 3455d9092..9ca7961ce 100644 --- a/src/Grpc.AspNetCore.Server/Grpc.AspNetCore.Server.csproj +++ b/src/Grpc.AspNetCore.Server/Grpc.AspNetCore.Server.csproj @@ -6,7 +6,7 @@ true true - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 README.md diff --git a/src/Grpc.AspNetCore.Server/Internal/HttpContextServerCallContext.cs b/src/Grpc.AspNetCore.Server/Internal/HttpContextServerCallContext.cs index 7a32e8ebe..5e1d51fa2 100644 --- a/src/Grpc.AspNetCore.Server/Internal/HttpContextServerCallContext.cs +++ b/src/Grpc.AspNetCore.Server/Internal/HttpContextServerCallContext.cs @@ -72,7 +72,7 @@ internal DefaultDeserializationContext DeserializationContext protected override string MethodCore => HttpContext.Request.Path.Value!; - protected override string HostCore => HttpContext.Request.Host.Value; + protected override string HostCore => HttpContext.Request.Host.Value!; protected override string PeerCore { diff --git a/src/Grpc.AspNetCore.Web/Grpc.AspNetCore.Web.csproj b/src/Grpc.AspNetCore.Web/Grpc.AspNetCore.Web.csproj index b00d87046..47ce8f2c0 100644 --- a/src/Grpc.AspNetCore.Web/Grpc.AspNetCore.Web.csproj +++ b/src/Grpc.AspNetCore.Web/Grpc.AspNetCore.Web.csproj @@ -6,7 +6,7 @@ true true - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 README.md diff --git a/src/Grpc.AspNetCore/Grpc.AspNetCore.csproj b/src/Grpc.AspNetCore/Grpc.AspNetCore.csproj index b1ddeab61..ebee3d50b 100644 --- a/src/Grpc.AspNetCore/Grpc.AspNetCore.csproj +++ b/src/Grpc.AspNetCore/Grpc.AspNetCore.csproj @@ -5,7 +5,7 @@ gRPC RPC HTTP/2 aspnetcore true - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 README.md diff --git a/src/Grpc.AspNetCore/lib/net9.0/_._ b/src/Grpc.AspNetCore/lib/net9.0/_._ new file mode 100644 index 000000000..e69de29bb diff --git a/src/Grpc.Net.Client/Balancer/PollingResolver.cs b/src/Grpc.Net.Client/Balancer/PollingResolver.cs index bbec7b675..0973f9339 100644 --- a/src/Grpc.Net.Client/Balancer/PollingResolver.cs +++ b/src/Grpc.Net.Client/Balancer/PollingResolver.cs @@ -147,7 +147,7 @@ public sealed override void Refresh() // Run ResolveAsync in a background task. // This is done to prevent synchronous block inside ResolveAsync from blocking future Refresh calls. - _resolveTask = Task.Run(() => ResolveNowAsync(_cts.Token), _cts.Token); + _resolveTask = Task.Run(() => ResolveNowAsync(_cts.Token)); _resolveTask.ContinueWith(static (t, state) => { var pollingResolver = (PollingResolver)state!; @@ -172,6 +172,8 @@ public sealed override void Refresh() private async Task ResolveNowAsync(CancellationToken cancellationToken) { + Log.ResolveStarting(_logger, GetType()); + // Reset resolve success to false. Will be set to true when an OK result is sent to listener. _resolveSuccessful = false; @@ -274,9 +276,12 @@ internal static class Log private static readonly Action _errorRetryingResolve = LoggerMessage.Define(LogLevel.Error, new EventId(6, "ErrorRetryingResolve"), "{ResolveType} error retrying resolve."); - private static readonly Action _resolveTaskCompleted = + private static readonly Action _resolveTaskCompleted = LoggerMessage.Define(LogLevel.Trace, new EventId(7, "ResolveTaskCompleted"), "{ResolveType} resolve task completed."); + private static readonly Action _resolveStarting = + LoggerMessage.Define(LogLevel.Trace, new EventId(8, "ResolveStarting"), "{ResolveType} resolve starting."); + public static void ResolverRefreshRequested(ILogger logger, Type resolverType) { _resolverRefreshRequested(logger, resolverType.Name, null); @@ -311,6 +316,11 @@ public static void ResolveTaskCompleted(ILogger logger, Type resolverType) { _resolveTaskCompleted(logger, resolverType.Name, null); } + + public static void ResolveStarting(ILogger logger, Type resolverType) + { + _resolveStarting(logger, resolverType.Name, null); + } } } #endif diff --git a/test/FunctionalTests/Balancer/DnsResolverTests.cs b/test/FunctionalTests/Balancer/DnsResolverTests.cs index 5f980240d..e85a82fc7 100644 --- a/test/FunctionalTests/Balancer/DnsResolverTests.cs +++ b/test/FunctionalTests/Balancer/DnsResolverTests.cs @@ -142,23 +142,23 @@ public async Task Refresh_Error_HasResult() AssertHasLog(LogLevel.Trace, "StartingResolveBackoff", "DnsResolver starting resolve backoff of 00:00:00.5000000."); } - private DnsResolver CreateDnsResolver(Uri address, int? defaultPort = null, TimeSpan? refreshInterval = null) + private DnsResolver CreateDnsResolver(Uri address, int? defaultPort = null, TimeSpan? refreshInterval = null, TimeSpan? backoffDuration = null) { return new DnsResolver(address, defaultPort ?? 80, LoggerFactory, refreshInterval ?? Timeout.InfiniteTimeSpan, new TestBackoffPolicyFactory()); } - internal class TestBackoffPolicyFactory : IBackoffPolicyFactory + internal class TestBackoffPolicyFactory(TimeSpan? backoffDuration = null) : IBackoffPolicyFactory { public IBackoffPolicy Create() { - return new TestBackoffPolicy(); + return new TestBackoffPolicy(backoffDuration ?? TimeSpan.FromSeconds(0.5)); } - private class TestBackoffPolicy : IBackoffPolicy + private class TestBackoffPolicy(TimeSpan backoffDuration) : IBackoffPolicy { public TimeSpan NextBackoff() { - return TimeSpan.FromSeconds(0.5); + return backoffDuration; } } } @@ -272,9 +272,10 @@ public async Task RefreshAsync_MultipleCallsThenCancellation_CallCanceled() // Arrange var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var dnsResolver = CreateDnsResolver(new Uri("dns:///localhost")); + var dnsResolver = CreateDnsResolver(new Uri("dns:///localhost"), backoffDuration: TimeSpan.FromSeconds(5)); dnsResolver.Start(r => { + Logger.LogInformation("Setting resolver results to TCS {TcsId}", System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(tcs)); tcs.TrySetResult(r); }); @@ -290,7 +291,10 @@ public async Task RefreshAsync_MultipleCallsThenCancellation_CallCanceled() await dnsResolver._resolveTask.DefaultTimeout(); Logger.LogInformation("Recreate TCS and refresh resolver again."); + tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + Logger.LogInformation("New TCS: {TcsId}", System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(tcs)); + dnsResolver.Refresh(); Logger.LogInformation("Dispose resolver while refresh is in progress. The refresh should be waiting for the min interval to complete."); diff --git a/test/FunctionalTests/Grpc.AspNetCore.FunctionalTests.csproj b/test/FunctionalTests/Grpc.AspNetCore.FunctionalTests.csproj index 7ca90678c..764ecff82 100644 --- a/test/FunctionalTests/Grpc.AspNetCore.FunctionalTests.csproj +++ b/test/FunctionalTests/Grpc.AspNetCore.FunctionalTests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 false true @@ -9,7 +9,7 @@ True - + SUPPORT_LOAD_BALANCING;$(DefineConstants) @@ -28,11 +28,6 @@ - - - - - @@ -65,6 +60,9 @@ + + + diff --git a/test/FunctionalTests/Infrastructure/GrpcTestFixture.cs b/test/FunctionalTests/Infrastructure/GrpcTestFixture.cs index 64d1af7dc..6c2c61e14 100644 --- a/test/FunctionalTests/Infrastructure/GrpcTestFixture.cs +++ b/test/FunctionalTests/Infrastructure/GrpcTestFixture.cs @@ -73,7 +73,9 @@ public static IPEndpointInfoContainer Create(ListenOptions listenOptions, bool i public class GrpcTestFixture : IDisposable where TStartup : class { - private readonly string _socketPath = Path.Combine(Path.GetTempPath(), "grpc-transporter.tmp"); +#if NET5_0_OR_GREATER + private readonly string _socketPath = Path.GetTempFileName(); +#endif private readonly InProcessTestServer _server; public GrpcTestFixture( @@ -308,10 +310,16 @@ public void Dispose() { Client.Dispose(); _server.Dispose(); +#if NET5_0_OR_GREATER + if (File.Exists(_socketPath)) + { + File.Delete(_socketPath); + } +#endif } #if NET6_0_OR_GREATER - private class Http3DelegatingHandler : DelegatingHandler +private class Http3DelegatingHandler : DelegatingHandler { public Http3DelegatingHandler(HttpMessageHandler innerHandler) { diff --git a/test/FunctionalTests/Linker/LinkerTests.cs b/test/FunctionalTests/Linker/LinkerTests.cs index 8cb05d84c..6c538db1e 100644 --- a/test/FunctionalTests/Linker/LinkerTests.cs +++ b/test/FunctionalTests/Linker/LinkerTests.cs @@ -34,19 +34,19 @@ public class LinkerTests { private static readonly TimeSpan Timeout = TimeSpan.FromSeconds(120); -#if NET8_0_OR_GREATER +#if NET9_0_OR_GREATER [Test] public async Task RunWebsiteAndCallWithClient_Aot_Success() { await RunWebsiteAndCallWithClient(publishAot: true); } -#endif [Test] public async Task RunWebsiteAndCallWithClient_Trimming_Success() { await RunWebsiteAndCallWithClient(publishAot: false); } +#endif private async Task RunWebsiteAndCallWithClient(bool publishAot) { diff --git a/test/Grpc.AspNetCore.Server.ClientFactory.Tests/Grpc.AspNetCore.Server.ClientFactory.Tests.csproj b/test/Grpc.AspNetCore.Server.ClientFactory.Tests/Grpc.AspNetCore.Server.ClientFactory.Tests.csproj index 00b441816..23b0efbc1 100644 --- a/test/Grpc.AspNetCore.Server.ClientFactory.Tests/Grpc.AspNetCore.Server.ClientFactory.Tests.csproj +++ b/test/Grpc.AspNetCore.Server.ClientFactory.Tests/Grpc.AspNetCore.Server.ClientFactory.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 false true diff --git a/test/Grpc.AspNetCore.Server.Tests/Grpc.AspNetCore.Server.Tests.csproj b/test/Grpc.AspNetCore.Server.Tests/Grpc.AspNetCore.Server.Tests.csproj index 747ba71af..90d3b6664 100644 --- a/test/Grpc.AspNetCore.Server.Tests/Grpc.AspNetCore.Server.Tests.csproj +++ b/test/Grpc.AspNetCore.Server.Tests/Grpc.AspNetCore.Server.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 false true diff --git a/test/Grpc.Net.Client.Tests/Balancer/ConnectionManagerTests.cs b/test/Grpc.Net.Client.Tests/Balancer/ConnectionManagerTests.cs index 98f7c7c4c..743639886 100644 --- a/test/Grpc.Net.Client.Tests/Balancer/ConnectionManagerTests.cs +++ b/test/Grpc.Net.Client.Tests/Balancer/ConnectionManagerTests.cs @@ -130,8 +130,11 @@ public async Task PickAsync_ChannelStateChangesWithWaitForReady_WaitsForCorrectE waitForReady: true, CancellationToken.None).AsTask().DefaultTimeout(); + _ = LogPickComplete(pickTask2, logger); + Assert.IsFalse(pickTask2.IsCompleted, "PickAsync should wait until an subchannel is ready."); + logger.LogInformation("Setting to ready subchannel."); resolver.UpdateAddresses(new List { new BalancerAddress("localhost", 82) @@ -139,6 +142,12 @@ public async Task PickAsync_ChannelStateChangesWithWaitForReady_WaitsForCorrectE var result2 = await pickTask2.DefaultTimeout(); Assert.AreEqual(new DnsEndPoint("localhost", 82), result2.Address!.EndPoint); + + static async Task LogPickComplete(Task<(Subchannel Subchannel, BalancerAddress Address, ISubchannelCallTracker? SubchannelCallTracker)> pickTask2, ILogger logger) + { + await pickTask2.DefaultTimeout(); + logger.LogInformation("PickAsync complete."); + } } [Test] diff --git a/test/Grpc.Net.Client.Tests/Balancer/PickFirstBalancerTests.cs b/test/Grpc.Net.Client.Tests/Balancer/PickFirstBalancerTests.cs index 84f209dde..b66555ff5 100644 --- a/test/Grpc.Net.Client.Tests/Balancer/PickFirstBalancerTests.cs +++ b/test/Grpc.Net.Client.Tests/Balancer/PickFirstBalancerTests.cs @@ -550,8 +550,13 @@ public async Task UnaryCall_TransportConnecting_ErrorAfterTransientFailure() await tcs.Task.DefaultTimeout(); // Assert - var pickStartedCount = testSink.Writes.Count(w => w.EventId.Name == "PickStarted"); - Assert.AreEqual(1, pickStartedCount); + await TestHelpers.AssertIsTrueRetryAsync( + () => + { + var pickStartedCount = testSink.Writes.Count(w => w.EventId.Name == "PickStarted"); + return pickStartedCount >= 1; + }, + "Wait for pick started.").DefaultTimeout(); transportFactory.Transports.Single().UpdateState(ConnectivityState.TransientFailure, new Status(StatusCode.Unavailable, "An error")); diff --git a/test/Grpc.Net.Client.Tests/Grpc.Net.Client.Tests.csproj b/test/Grpc.Net.Client.Tests/Grpc.Net.Client.Tests.csproj index 73a63531b..a04c10f08 100644 --- a/test/Grpc.Net.Client.Tests/Grpc.Net.Client.Tests.csproj +++ b/test/Grpc.Net.Client.Tests/Grpc.Net.Client.Tests.csproj @@ -1,12 +1,12 @@ - net462;net6.0;net7.0;net8.0 + net462;net6.0;net7.0;net8.0;net9.0 false true - + SUPPORT_LOAD_BALANCING;$(DefineConstants) diff --git a/test/Grpc.Net.Client.Web.Tests/Grpc.Net.Client.Web.Tests.csproj b/test/Grpc.Net.Client.Web.Tests/Grpc.Net.Client.Web.Tests.csproj index 4a28bef2c..8b573508b 100644 --- a/test/Grpc.Net.Client.Web.Tests/Grpc.Net.Client.Web.Tests.csproj +++ b/test/Grpc.Net.Client.Web.Tests/Grpc.Net.Client.Web.Tests.csproj @@ -1,7 +1,7 @@ - net462;net6.0;net7.0;net8.0 + net462;net6.0;net7.0;net8.0;net9.0 false true diff --git a/test/Grpc.Net.ClientFactory.Tests/Grpc.Net.ClientFactory.Tests.csproj b/test/Grpc.Net.ClientFactory.Tests/Grpc.Net.ClientFactory.Tests.csproj index a78247ee4..d134fd140 100644 --- a/test/Grpc.Net.ClientFactory.Tests/Grpc.Net.ClientFactory.Tests.csproj +++ b/test/Grpc.Net.ClientFactory.Tests/Grpc.Net.ClientFactory.Tests.csproj @@ -1,7 +1,7 @@ - net462;net6.0;net7.0;net8.0 + net462;net6.0;net7.0;net8.0;net9.0 false true true diff --git a/test/Grpc.StatusProto.Tests/Grpc.StatusProto.Tests.csproj b/test/Grpc.StatusProto.Tests/Grpc.StatusProto.Tests.csproj index 79555410c..ab1751a89 100644 --- a/test/Grpc.StatusProto.Tests/Grpc.StatusProto.Tests.csproj +++ b/test/Grpc.StatusProto.Tests/Grpc.StatusProto.Tests.csproj @@ -1,6 +1,6 @@ - net462;net6.0;net7.0;net8.0 + net462;net6.0;net7.0;net8.0;net9.0 true diff --git a/test/dotnet-grpc.Tests/dotnet-grpc.Tests.csproj b/test/dotnet-grpc.Tests/dotnet-grpc.Tests.csproj index acf7f773d..e6ccc8110 100644 --- a/test/dotnet-grpc.Tests/dotnet-grpc.Tests.csproj +++ b/test/dotnet-grpc.Tests/dotnet-grpc.Tests.csproj @@ -2,7 +2,7 @@ - net8.0 + net9.0 false Grpc.Dotnet.Cli.Tests diff --git a/testassets/BenchmarkWorkerWebsite/BenchmarkWorkerWebsite.csproj b/testassets/BenchmarkWorkerWebsite/BenchmarkWorkerWebsite.csproj index 53dc4ee86..ce5b40be2 100644 --- a/testassets/BenchmarkWorkerWebsite/BenchmarkWorkerWebsite.csproj +++ b/testassets/BenchmarkWorkerWebsite/BenchmarkWorkerWebsite.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 InProcess false @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/testassets/FunctionalTestsWebsite/FunctionalTestsWebsite.csproj b/testassets/FunctionalTestsWebsite/FunctionalTestsWebsite.csproj index faf0d8bc5..9dcaad9b5 100644 --- a/testassets/FunctionalTestsWebsite/FunctionalTestsWebsite.csproj +++ b/testassets/FunctionalTestsWebsite/FunctionalTestsWebsite.csproj @@ -2,7 +2,7 @@ - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 InProcess false diff --git a/testassets/InteropTestsClient/InteropTestsClient.csproj b/testassets/InteropTestsClient/InteropTestsClient.csproj index 8912d97e9..3ebd216d0 100644 --- a/testassets/InteropTestsClient/InteropTestsClient.csproj +++ b/testassets/InteropTestsClient/InteropTestsClient.csproj @@ -2,15 +2,10 @@ Exe - net8.0;net7.0;net6.0;net462 - net8.0 + net9.0;net8.0;net7.0;net6.0;net462 + net9.0 - - - - - diff --git a/testassets/InteropTestsGrpcWebClient/InteropTestsGrpcWebClient.csproj b/testassets/InteropTestsGrpcWebClient/InteropTestsGrpcWebClient.csproj index aa7946604..3e1663dda 100644 --- a/testassets/InteropTestsGrpcWebClient/InteropTestsGrpcWebClient.csproj +++ b/testassets/InteropTestsGrpcWebClient/InteropTestsGrpcWebClient.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 BLAZOR_WASM true diff --git a/testassets/InteropTestsGrpcWebWebsite/Dockerfile b/testassets/InteropTestsGrpcWebWebsite/Dockerfile index a38769bae..c8ecbf5c2 100644 --- a/testassets/InteropTestsGrpcWebWebsite/Dockerfile +++ b/testassets/InteropTestsGrpcWebWebsite/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/nightly/sdk:9.0-preview AS build-env WORKDIR /app # Copy everything @@ -8,7 +8,7 @@ RUN dotnet restore testassets/InteropTestsGrpcWebWebsite RUN dotnet publish testassets/InteropTestsGrpcWebWebsite -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/nightly/aspnet:9.0-preview WORKDIR /app COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "InteropTestsGrpcWebWebsite.dll", "--urls", "http://+:80"] diff --git a/testassets/InteropTestsGrpcWebWebsite/InteropTestsGrpcWebWebsite.csproj b/testassets/InteropTestsGrpcWebWebsite/InteropTestsGrpcWebWebsite.csproj index 21eb23201..100f66fb4 100644 --- a/testassets/InteropTestsGrpcWebWebsite/InteropTestsGrpcWebWebsite.csproj +++ b/testassets/InteropTestsGrpcWebWebsite/InteropTestsGrpcWebWebsite.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/testassets/InteropTestsNativeServer/InteropTestsNativeServer.csproj b/testassets/InteropTestsNativeServer/InteropTestsNativeServer.csproj index 47f83aa54..1076eb19c 100644 --- a/testassets/InteropTestsNativeServer/InteropTestsNativeServer.csproj +++ b/testassets/InteropTestsNativeServer/InteropTestsNativeServer.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 diff --git a/testassets/InteropTestsWebsite/Dockerfile b/testassets/InteropTestsWebsite/Dockerfile index 333c9bbc8..16e916257 100644 --- a/testassets/InteropTestsWebsite/Dockerfile +++ b/testassets/InteropTestsWebsite/Dockerfile @@ -1,14 +1,14 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/nightly/sdk:9.0-preview AS build-env WORKDIR /app # Copy everything COPY . ./ RUN dotnet --info RUN dotnet restore testassets/InteropTestsWebsite -RUN dotnet publish testassets/InteropTestsWebsite --framework net8.0 -c Release -o out -p:LatestFramework=true +RUN dotnet publish testassets/InteropTestsWebsite --framework net9.0 -c Release -o out -p:LatestFramework=true # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/nightly/aspnet:9.0-preview WORKDIR /app COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "InteropTestsWebsite.dll", "--port_http1", "80"] \ No newline at end of file diff --git a/testassets/InteropTestsWebsite/InteropTestsWebsite.csproj b/testassets/InteropTestsWebsite/InteropTestsWebsite.csproj index ec4a60184..6a5c61a1a 100644 --- a/testassets/InteropTestsWebsite/InteropTestsWebsite.csproj +++ b/testassets/InteropTestsWebsite/InteropTestsWebsite.csproj @@ -1,8 +1,8 @@ - net8.0 - net8.0 + net9.0 + net9.0 InProcess false diff --git a/testassets/LinkerTestsClient/LinkerTestsClient.csproj b/testassets/LinkerTestsClient/LinkerTestsClient.csproj index 86d03f466..9cb327f97 100644 --- a/testassets/LinkerTestsClient/LinkerTestsClient.csproj +++ b/testassets/LinkerTestsClient/LinkerTestsClient.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 Exe true $(AppPublishAot) diff --git a/testassets/LinkerTestsWebsite/LinkerTestsWebsite.csproj b/testassets/LinkerTestsWebsite/LinkerTestsWebsite.csproj index c64180f3f..af85e659e 100644 --- a/testassets/LinkerTestsWebsite/LinkerTestsWebsite.csproj +++ b/testassets/LinkerTestsWebsite/LinkerTestsWebsite.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 Exe true $(AppPublishAot)