From 7d92b4ab86281d8f041d79c1b01018c98a211286 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 15:02:28 -0600 Subject: [PATCH 01/22] Bump xunit.runner.visualstudio from 2.4.5 to 2.5.0 (#210) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.4.5 to 2.5.0. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/v2.4.5...2.5.0) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c15928be..3ac312f9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,7 +6,7 @@ - + From 4822f178831d771c1d28288703651b687e22f593 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 10 Jul 2023 15:07:54 -0600 Subject: [PATCH 02/22] Bump MicroBuildVersion to 2.0.131 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 250a08a5..e5884284 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ true true - 2.0.130 + 2.0.131 From 2e19c89761d8d7f934250f4effca22136c48cf39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:08:52 +0000 Subject: [PATCH 03/22] Bump xunit from 2.4.2 to 2.5.0 (#209) --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3ac312f9..6af95c88 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -7,7 +7,7 @@ - + From 75b0953f6e91e66076030f20fa0bc4a2990ad906 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 10 Jul 2023 15:25:18 -0600 Subject: [PATCH 04/22] Remove `tool run` from `dotnet nbgv` invocation I have an Azure Pipeline where `InsertVersionsValues.ps1` (in the microbuild branch) works but this step fails, and the only difference is that one omits `tool run` from `dotnet nbgv`. I continue to believe this is a bug in the `dotnet tool` command. --- azure-pipelines/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index 2e2f426e..9c445f72 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -17,7 +17,7 @@ jobs: clean: true - template: install-dependencies.yml - - script: dotnet tool run nbgv cloud -c + - script: dotnet nbgv cloud -c displayName: ⚙ Set build number - template: dotnet.yml From 442ca7c6e521a55a39351b9ef3a3b81207fa4ef5 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 10 Jul 2023 16:12:43 -0600 Subject: [PATCH 05/22] Dependabot to ignore dotnet-format --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 63e3e890..484f2bfc 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,3 +7,7 @@ updates: directory: / schedule: interval: weekly + ignore: + # This package has unlisted versions on nuget.org that are not supported. Avoid them. + - dependency-name: dotnet-format + versions: ["6.x", "7.x", "8.x"] From b379933ef3581bd4904e883d92ebcd72a018a321 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 10 Jul 2023 19:46:17 -0600 Subject: [PATCH 06/22] Set tab settings for .ps1 files --- .editorconfig | 4 ++++ .vscode/settings.json | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index fce73c07..959801c2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -32,6 +32,10 @@ indent_size = 2 indent_size = 2 indent_style = space +[*.ps1] +indent_style = space +indent_size = 4 + # Dotnet code style settings: [*.{cs,vb}] # Sort using and Import directives with System.* appearing first diff --git a/.vscode/settings.json b/.vscode/settings.json index 3ae1371c..54c5c689 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,6 @@ "files.insertFinalNewline": true, "files.trimFinalNewlines": true, "omnisharp.enableEditorConfigSupport": true, - "omnisharp.enableImportCompletion": true, - "omnisharp.enableRoslynAnalyzers": true + "omnisharp.enableRoslynAnalyzers": true, + "dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true } From 0f7accdd5ed39690633bba7a7f9f83f3caf0b970 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 07:37:40 -0600 Subject: [PATCH 07/22] Bump powershell from 7.3.5 to 7.3.6 (#212) Bumps [powershell](https://github.com/PowerShell/PowerShell) from 7.3.5 to 7.3.6. - [Release notes](https://github.com/PowerShell/PowerShell/releases) - [Commits](https://github.com/PowerShell/PowerShell/compare/v7.3.5...v7.3.6) --- updated-dependencies: - dependency-name: powershell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index e344d8b0..f8713e90 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "powershell": { - "version": "7.3.5", + "version": "7.3.6", "commands": [ "pwsh" ] From 05a925a4be9598efcffce2fdd7fb3135d5f7f8be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 07:38:14 -0600 Subject: [PATCH 08/22] Bump dotnet-coverage from 17.7.3 to 17.8.0 (#211) Bumps [dotnet-coverage](https://github.com/microsoft/codecoverage) from 17.7.3 to 17.8.0. - [Commits](https://github.com/microsoft/codecoverage/commits) --- updated-dependencies: - dependency-name: dotnet-coverage dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f8713e90..05b6b5bb 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-coverage": { - "version": "17.7.3", + "version": "17.8.0", "commands": [ "dotnet-coverage" ] From 0cc89db1dda3f9c7a436bea77e903f17baf7a989 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sat, 22 Jul 2023 11:14:58 -0600 Subject: [PATCH 09/22] Bump dotnet-coverage to 17.8.2 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 05b6b5bb..a20f90b9 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-coverage": { - "version": "17.8.0", + "version": "17.8.2", "commands": [ "dotnet-coverage" ] From 5c6330dc1ad8a1a4406915d4cfaa2defb08ebeea Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 24 Jul 2023 09:22:56 -0600 Subject: [PATCH 10/22] Bump MicroBuild version to 2.0.134 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 7d021ab8..fa07578d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ true true - 2.0.131 + 2.0.134 From 2651c692388aa2e27213c7b89959de56b81f1ecb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Aug 2023 10:09:53 -0600 Subject: [PATCH 11/22] Bump Microsoft.NET.Test.Sdk from 17.6.3 to 17.7.0 (#213) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.6.3 to 17.7.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.6.3...v17.7.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6af95c88..58a5a265 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ true - + From 492d96f3c3c136ba9a504a4524ca8616df222779 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 11 Aug 2023 08:15:54 -0600 Subject: [PATCH 12/22] Bump Microbuild version to 2.0.137 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index fa07578d..fb6c9c8f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ true true - 2.0.134 + 2.0.137 From 821514da53b285a41ce1188f98dcb94faaacadff Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 17 Aug 2023 15:51:51 -0600 Subject: [PATCH 13/22] Tolerate NOTICE file task network failures --- azure-pipelines/microbuild.before.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines/microbuild.before.yml b/azure-pipelines/microbuild.before.yml index c933df23..adb5ccc8 100644 --- a/azure-pipelines/microbuild.before.yml +++ b/azure-pipelines/microbuild.before.yml @@ -8,6 +8,7 @@ steps: outputfile: $(System.DefaultWorkingDirectory)/obj/NOTICE outputformat: text condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + retryCountOnTaskFailure: 3 # fails when the cloud service is overloaded - task: MicroBuildSigningPlugin@4 inputs: From f764c84caec60eff9579c03ce16db43b142c2d74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:15:30 -0600 Subject: [PATCH 14/22] Bump Microsoft.NET.Test.Sdk from 17.7.0 to 17.7.1 (#214) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.7.0 to 17.7.1. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.7.0...v17.7.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 58a5a265..8d540894 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ true - + From 05f9dd77512332bdd8a312db97bd07d26084b935 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 15:18:33 +0000 Subject: [PATCH 15/22] Bump dotnet-coverage from 17.8.2 to 17.8.4 (#215) Bumps [dotnet-coverage](https://github.com/microsoft/codecoverage) from 17.8.2 to 17.8.4. - [Commits](https://github.com/microsoft/codecoverage/commits) --- updated-dependencies: - dependency-name: dotnet-coverage dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index a20f90b9..2b62ebce 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-coverage": { - "version": "17.8.2", + "version": "17.8.4", "commands": [ "dotnet-coverage" ] From c8abc41f0afd07c570d13d6ac41134da00485d91 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 31 Aug 2023 10:41:26 -0600 Subject: [PATCH 16/22] Align YAML indentation more consistently --- .github/dependabot.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 484f2bfc..a0e8933b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,6 @@ updates: schedule: interval: weekly ignore: - # This package has unlisted versions on nuget.org that are not supported. Avoid them. - - dependency-name: dotnet-format - versions: ["6.x", "7.x", "8.x"] + # This package has unlisted versions on nuget.org that are not supported. Avoid them. + - dependency-name: dotnet-format + versions: ["6.x", "7.x", "8.x"] From 295313bfbc59d3c6fe8fa4c9e5f080d86d236f95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Aug 2023 11:27:21 -0600 Subject: [PATCH 17/22] Bump Microsoft.NET.Test.Sdk from 17.7.1 to 17.7.2 (#218) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.7.1 to 17.7.2. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.7.1...v17.7.2) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8d540894..76d18e0d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ true - + From 0a35e80ec55441fc0c10d2ea68cd03e6b4c64004 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 5 Sep 2023 15:31:49 -0600 Subject: [PATCH 18/22] Fix typo in comment --- src/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 5be1dd44..5e648d5e 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,5 +1,5 @@ - + README.md From 32ad8867b7b3ba1a37772ac82f1da6b939295c14 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 5 Sep 2023 15:42:38 -0600 Subject: [PATCH 19/22] Bump MicroBuildVersion to 2.0.146 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 963ff8fe..d8c93d28 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ true true - 2.0.137 + 2.0.146 From cf980d71f2dc30d777674b77a1afef6a1e8ddd72 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 8 Sep 2023 10:43:58 -0600 Subject: [PATCH 20/22] Bump dotnet-coverage to 17.8.6 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2b62ebce..d93241f4 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-coverage": { - "version": "17.8.4", + "version": "17.8.6", "commands": [ "dotnet-coverage" ] From 287517685f507f78676a435ceadbd4aa292f58e2 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 21 Sep 2023 10:44:25 -0600 Subject: [PATCH 21/22] Bump more dependency versions --- Directory.Packages.props | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 03f02f89..98d43f14 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,7 +6,7 @@ 2.5.108 2.0.146 - 17.6.40 + 17.7.35 @@ -34,11 +34,11 @@ - - + + - + From 1feb4914a8de326139cf83828dedc4db2bea051e Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 21 Sep 2023 10:57:18 -0600 Subject: [PATCH 22/22] Fix up build warnings after xunit upgrade --- test/StreamJsonRpc.Tests/AsyncEnumerableTests.cs | 2 +- .../StreamJsonRpc.Tests/DuplexPipeMarshalingTests.cs | 6 +++--- test/StreamJsonRpc.Tests/JsonRpcRemoteTargetTests.cs | 12 ++++++------ .../StreamJsonRpc.Tests/StreamMessageHandlerTests.cs | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/StreamJsonRpc.Tests/AsyncEnumerableTests.cs b/test/StreamJsonRpc.Tests/AsyncEnumerableTests.cs index 6cbe8a40..e09b86fc 100644 --- a/test/StreamJsonRpc.Tests/AsyncEnumerableTests.cs +++ b/test/StreamJsonRpc.Tests/AsyncEnumerableTests.cs @@ -191,7 +191,7 @@ public async Task GetIAsyncEnumerableAsReturnType_MinBatchSize(bool useProxy) // Within a batch, the MoveNextAsync call should absolutely complete synchronously. ValueTask valueTask = enumerator.MoveNextAsync(); Assert.True(valueTask.IsCompleted); - Assert.True(valueTask.GetAwaiter().GetResult()); + Assert.True(await valueTask); } int number = enumerator.Current; diff --git a/test/StreamJsonRpc.Tests/DuplexPipeMarshalingTests.cs b/test/StreamJsonRpc.Tests/DuplexPipeMarshalingTests.cs index 9abc63e3..56187ba1 100644 --- a/test/StreamJsonRpc.Tests/DuplexPipeMarshalingTests.cs +++ b/test/StreamJsonRpc.Tests/DuplexPipeMarshalingTests.cs @@ -291,7 +291,7 @@ await this.clientRpc.InvokeWithParameterObjectAsync( public async Task ServerMethodThatReturnsStream() { using StreamReader result = new StreamReader(await this.clientRpc.InvokeAsync(nameof(Server.ServerMethodThatReturnsStream))); - string returnedContent = await result.ReadToEndAsync().ConfigureAwait(false); + string returnedContent = await result.ReadToEndAsync(); Assert.Equal("Streamed bits!", returnedContent); } @@ -305,11 +305,11 @@ public async Task ClientCanWriteAndReadFromTwoWayStream() var writeOnlyStream = new StreamWriter(remoteStream); // Read server message - var serverReply = await readOnlyStream.ReadLineAsync().ConfigureAwait(false); + var serverReply = await readOnlyStream.ReadLineAsync(); Assert.Equal("Streamed bits!", serverReply); // Verify server received client response - await writeOnlyStream.WriteLineAsync("Returned bytes").ConfigureAwait(false); + await writeOnlyStream.WriteLineAsync("Returned bytes"); await writeOnlyStream.FlushAsync().WithCancellation(this.TimeoutToken); Assumes.NotNull(this.server.ChatLaterTask); diff --git a/test/StreamJsonRpc.Tests/JsonRpcRemoteTargetTests.cs b/test/StreamJsonRpc.Tests/JsonRpcRemoteTargetTests.cs index fd5574ca..04508546 100644 --- a/test/StreamJsonRpc.Tests/JsonRpcRemoteTargetTests.cs +++ b/test/StreamJsonRpc.Tests/JsonRpcRemoteTargetTests.cs @@ -169,8 +169,8 @@ public async Task InvokeRemoteTargetWithExistingId() await Task.WhenAll(resultLocalTask, resultRemoteTask); - Assert.Equal(5, resultLocalTask.Result); - Assert.Equal(2, resultRemoteTask.Result); + Assert.Equal(5, await resultLocalTask); + Assert.Equal(2, await resultRemoteTask); } [Fact] @@ -215,8 +215,8 @@ public async Task VerifyMethodsAreInvokedInOrderBeforeYielding() await Task.WhenAll(relaySleepCallTask, remoteCallTask); Assert.Equal(1, LocalOriginTarget.InvokeCount); - Assert.Equal(2, relaySleepCallTask.Result); - Assert.Equal(3, remoteCallTask.Result); + Assert.Equal(2, await relaySleepCallTask); + Assert.Equal(3, await remoteCallTask); } [Fact(Skip = "Unstable. See https://github.com/microsoft/vs-streamjsonrpc/issues/336")] @@ -240,8 +240,8 @@ public async Task VerifyMethodOrderingIsNotGuaranteedAfterYielding() await Task.WhenAll(relayDelayCallTask, remoteCallTask); Assert.Equal(1, LocalOriginTarget.InvokeCount); - Assert.Equal(3, relayDelayCallTask.Result); - Assert.Equal(2, remoteCallTask.Result); + Assert.Equal(3, await relayDelayCallTask); + Assert.Equal(2, await remoteCallTask); } protected virtual IJsonRpcMessageHandler CreateHandler(Stream sending, Stream receiving) => new HeaderDelimitedMessageHandler(sending, receiving, this.CreateFormatter()); diff --git a/test/StreamJsonRpc.Tests/StreamMessageHandlerTests.cs b/test/StreamJsonRpc.Tests/StreamMessageHandlerTests.cs index 13137082..dcbf545b 100644 --- a/test/StreamJsonRpc.Tests/StreamMessageHandlerTests.cs +++ b/test/StreamJsonRpc.Tests/StreamMessageHandlerTests.cs @@ -82,7 +82,7 @@ public async Task WriteAsync_ThrowsObjectDisposedException() { await this.handler.DisposeAsync(); ValueTask result = this.handler.WriteAsync(CreateNotifyMessage(), this.TimeoutToken); - Assert.Throws(() => result.GetAwaiter().GetResult()); + await Assert.ThrowsAsync(async () => await result); } /// @@ -93,7 +93,7 @@ public async Task WriteAsync_ThrowsObjectDisposedException() public async Task WriteAsync_PreferOperationCanceledException_AtEntry() { await this.handler.DisposeAsync(); - Assert.Throws(() => this.handler.WriteAsync(CreateNotifyMessage(), PrecanceledToken).GetAwaiter().GetResult()); + await Assert.ThrowsAsync(async () => await this.handler.WriteAsync(CreateNotifyMessage(), PrecanceledToken)); } /// @@ -143,8 +143,8 @@ public async Task ReadAsync_ThrowsObjectDisposedException() { await this.handler.DisposeAsync(); ValueTask result = this.handler.ReadAsync(this.TimeoutToken); - Assert.Throws(() => result.GetAwaiter().GetResult()); - Assert.Throws(() => this.handler.ReadAsync(PrecanceledToken).GetAwaiter().GetResult()); + await Assert.ThrowsAsync(async () => await result); + await Assert.ThrowsAsync(async () => await this.handler.ReadAsync(PrecanceledToken)); } /// @@ -155,7 +155,7 @@ public async Task ReadAsync_ThrowsObjectDisposedException() public async Task ReadAsync_PreferOperationCanceledException_AtEntry() { await this.handler.DisposeAsync(); - Assert.Throws(() => this.handler.ReadAsync(PrecanceledToken).GetAwaiter().GetResult()); + await Assert.ThrowsAsync(async () => await this.handler.ReadAsync(PrecanceledToken)); } ///