From c129d6ed29946483a20d2e2a531676e5b3a86894 Mon Sep 17 00:00:00 2001 From: tmat Date: Sun, 24 Nov 2024 11:57:13 -0800 Subject: [PATCH 1/3] Fix `Change failed to apply (error code: ...)` intermittent failures --- .../dotnet-watch/HotReload/DefaultDeltaApplier.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BuiltInTools/dotnet-watch/HotReload/DefaultDeltaApplier.cs b/src/BuiltInTools/dotnet-watch/HotReload/DefaultDeltaApplier.cs index ca0fe1297410..4c703612ffb3 100644 --- a/src/BuiltInTools/dotnet-watch/HotReload/DefaultDeltaApplier.cs +++ b/src/BuiltInTools/dotnet-watch/HotReload/DefaultDeltaApplier.cs @@ -136,10 +136,11 @@ private async Task ReceiveApplyUpdateResult(CancellationToken cancellation var status = ArrayPool.Shared.Rent(1); try { - var statusBytesRead = await _pipe.ReadAsync(status, cancellationToken); + var statusBytesRead = await _pipe.ReadAsync(status, offset: 0, count: 1, cancellationToken); if (statusBytesRead != 1 || status[0] != UpdatePayload.ApplySuccessValue) { - Reporter.Error($"Change failed to apply (error code: '{BitConverter.ToString(status, 0, statusBytesRead)}'). Further changes won't be applied to this process."); + var message = (statusBytesRead == 0) ? "received no data" : $"received status 0x{status[0]:x2}"; + Reporter.Error($"Change failed to apply ({message}). Further changes won't be applied to this process."); return false; } From 6239f3e74b2a96f79e87a8b37b768b1673dd58b9 Mon Sep 17 00:00:00 2001 From: Tomas Matousek Date: Thu, 5 Dec 2024 15:19:33 -0800 Subject: [PATCH 2/3] Restore detailed test logging to console output --- .../SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs b/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs index 99f111f3c177..24b8237217b1 100644 --- a/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs +++ b/test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs @@ -152,7 +152,7 @@ private async Task> PrepareWorkItem(ITaskItem xunitProject) var testFilter = string.IsNullOrEmpty(assemblyPartitionInfo.ClassListArgumentString) ? "" : $"--filter \"{assemblyPartitionInfo.ClassListArgumentString}\""; command = $"{driver} test {assemblyName} -e HELIX_WORK_ITEM_TIMEOUT={timeout} {testExecutionDirectory} {msbuildAdditionalSdkResolverFolder} " + - $"{(XUnitArguments != null ? " " + XUnitArguments : "")} --results-directory .{Path.DirectorySeparatorChar} --logger trx --blame-hang --blame-hang-timeout 30m {testFilter} -- {arguments}"; + $"{(XUnitArguments != null ? " " + XUnitArguments : "")} --results-directory .{Path.DirectorySeparatorChar} --logger trx --logger \"console;verbosity=detailed\" --blame-hang --blame-hang-timeout 30m {testFilter} -- {arguments}"; Log.LogMessage($"Creating work item with properties Identity: {assemblyName}, PayloadDirectory: {publishDirectory}, Command: {command}"); From 09d57867b78d14aeb357cf88490e21a69da59084 Mon Sep 17 00:00:00 2001 From: Tomas Matousek Date: Fri, 13 Dec 2024 12:51:11 -0800 Subject: [PATCH 3/3] Skip test --- test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs b/test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs index 23f3076915a9..1ced8644525a 100644 --- a/test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs +++ b/test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs @@ -68,7 +68,7 @@ public static void Print() await App.AssertOutputLineStartsWith("Changed!"); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/sdk/issues/45457")] public async Task ChangeFileInFSharpProject() { var testAsset = TestAssets.CopyTestAsset("FSharpTestAppSimple")