diff --git a/tests/Tgstation.Server.Tests/TestVersions.cs b/tests/Tgstation.Server.Tests/TestVersions.cs index d7d10c5338..1e5fc87139 100644 --- a/tests/Tgstation.Server.Tests/TestVersions.cs +++ b/tests/Tgstation.Server.Tests/TestVersions.cs @@ -406,7 +406,7 @@ namespace Tgstation.Server.Tests Assert.AreEqual(latestMigrationSL, DatabaseContext.SLLatestMigration); } - static async Task> GetByondVersionPriorTo(ByondInstallerBase byondInstaller, Version version) + static async Task> GetByondVersionPriorTo(ByondInstallerBase byondInstaller, Version version) { var minusOneMinor = new Version(version.Major, version.Minor - 1); var byondVersion = new ByondVersion diff --git a/tests/Tgstation.Server.Tests/TestingUtils.cs b/tests/Tgstation.Server.Tests/TestingUtils.cs index 51f1bf3f13..b40e940e39 100644 --- a/tests/Tgstation.Server.Tests/TestingUtils.cs +++ b/tests/Tgstation.Server.Tests/TestingUtils.cs @@ -33,7 +33,7 @@ namespace Tgstation.Server.Tests return mockLoggerFactory.Object; } - public static async ValueTask ExtractMemoryStreamFromInstallationData(IEngineInstallationData engineInstallationData, CancellationToken cancellationToken) + public static async ValueTask ExtractMemoryStreamFromInstallationData(IEngineInstallationData engineInstallationData, CancellationToken cancellationToken) { if (engineInstallationData is ZipStreamEngineInstallationData zipStreamData) return (MemoryStream)zipStreamData.GetType().GetField("zipStream", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(zipStreamData); @@ -44,7 +44,15 @@ namespace Tgstation.Server.Tests try { await repoData.ExtractToPath(tempFolder, cancellationToken); - var resultStream = new MemoryStream(); + var resultStream = new FileStream( + $"{tempFolder}.zip", + FileMode.Create, + FileAccess.ReadWrite, + FileShare.Read | FileShare.Delete, + 4096, + FileOptions.Asynchronous); + + File.Delete(resultStream.Name); // now we have a ghost file that will delete when the stream closes try { ZipFile.CreateFromDirectory(tempFolder, resultStream, CompressionLevel.NoCompression, false);