From e81f545b0a801d96b20089173f096bb95a2fb8ce Mon Sep 17 00:00:00 2001 From: HVbajoria Date: Mon, 13 Oct 2025 23:50:51 +0530 Subject: [PATCH 1/2] Fix AppHost Bundle Tests I/O Failures and Update Package Release Notes URL --- Directory.Build.props | 2 +- .../BundledAppWithSubDirs.cs | 39 ++++++++++++++----- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 99eee260233d71..2dfa0a39cf91f3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -239,7 +239,7 @@ false $(CopyrightNetFoundation) $(MSBuildThisFileDirectory)THIRD-PARTY-NOTICES.TXT - https://go.microsoft.com/fwlink/?LinkID=799421 + https://github.com/dotnet/core/tree/main/release-notes $(MSBuildProjectName.Contains('Private')) true diff --git a/src/installer/tests/AppHost.Bundle.Tests/BundledAppWithSubDirs.cs b/src/installer/tests/AppHost.Bundle.Tests/BundledAppWithSubDirs.cs index 05381dc87d440e..17849a8c54eb12 100644 --- a/src/installer/tests/AppHost.Bundle.Tests/BundledAppWithSubDirs.cs +++ b/src/installer/tests/AppHost.Bundle.Tests/BundledAppWithSubDirs.cs @@ -50,13 +50,22 @@ private static void DeleteExtractionDirectory(CommandResult result) return; string extractionDir = match.Groups[1].Value; - try + for (int i = 0; i < 3; i++) { - Directory.Delete(extractionDir, true); - } - catch (Exception ex) - { - Console.WriteLine($"Failed to delete extraction directory '{extractionDir}': {ex}"); + try + { + if (Directory.Exists(extractionDir)) + Directory.Delete(extractionDir, true); + break; + } + catch (Exception ex) when (i < 2) + { + System.Threading.Thread.Sleep(100); + } + catch (Exception ex) + { + Console.WriteLine($"Failed to delete extraction directory '{extractionDir}': {ex}"); + } } } @@ -187,10 +196,22 @@ public static void AddLongNameContent(string directory) // This prevents git-clone of the repo from failing if long-file-name support is not enabled on windows. var longDirName = "This is a really, really, really, really, really, really, really, really, really, really, really, really, really, really long file name for punctuation"; var longDirPath = Path.Combine(directory, "Sentence", longDirName); - Directory.CreateDirectory(longDirPath); - using (var writer = File.CreateText(Path.Combine(longDirPath, "word"))) + + for (int i = 0; i < 3; i++) { - writer.Write("."); + try + { + Directory.CreateDirectory(longDirPath); + using (var writer = File.CreateText(Path.Combine(longDirPath, "word"))) + { + writer.Write("."); + } + break; + } + catch (IOException) when (i < 2) + { + System.Threading.Thread.Sleep(100); + } } } } From 7ec0062edd3f462512e8798df9d56888f5543394 Mon Sep 17 00:00:00 2001 From: Harshavardhan Bajoria <62978274+HVbajoria@users.noreply.github.com> Date: Tue, 14 Oct 2025 00:16:22 +0530 Subject: [PATCH 2/2] Discarded change --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 2dfa0a39cf91f3..99eee260233d71 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -239,7 +239,7 @@ false $(CopyrightNetFoundation) $(MSBuildThisFileDirectory)THIRD-PARTY-NOTICES.TXT - https://github.com/dotnet/core/tree/main/release-notes + https://go.microsoft.com/fwlink/?LinkID=799421 $(MSBuildProjectName.Contains('Private')) true