diff --git a/osu.Game.Tests/Collections/IO/ImportCollectionsTest.cs b/osu.Game.Tests/Collections/IO/ImportCollectionsTest.cs
index d87ac29d75..ef1c993a66 100644
--- a/osu.Game.Tests/Collections/IO/ImportCollectionsTest.cs
+++ b/osu.Game.Tests/Collections/IO/ImportCollectionsTest.cs
@@ -128,7 +128,7 @@ namespace osu.Game.Tests.Collections.IO
[Test]
public async Task TestSaveAndReload()
{
- using (HeadlessGameHost host = new TestRunHeadlessGameHost("TestSaveAndReload", bypassCleanup: true))
+ using (HeadlessGameHost host = new CleanRunHeadlessGameHost(bypassCleanup: true))
{
try
{
@@ -149,7 +149,7 @@ namespace osu.Game.Tests.Collections.IO
}
}
- using (HeadlessGameHost host = new TestRunHeadlessGameHost("TestSaveAndReload"))
+ using (HeadlessGameHost host = new TestRunHeadlessGameHost(nameof(TestSaveAndReload)))
{
try
{
diff --git a/osu.Game/Tests/CleanRunHeadlessGameHost.cs b/osu.Game/Tests/CleanRunHeadlessGameHost.cs
index d7ab769ac4..7d7f011f6a 100644
--- a/osu.Game/Tests/CleanRunHeadlessGameHost.cs
+++ b/osu.Game/Tests/CleanRunHeadlessGameHost.cs
@@ -17,9 +17,10 @@ namespace osu.Game.Tests
/// An optional suffix which will isolate this host from others called from the same method source.
/// Whether to bind IPC channels.
/// Whether the host should be forced to run in realtime, rather than accelerated test time.
+ /// Whether to bypass directory cleanup on host disposal. Should be used only if a subsequent test relies on the files still existing.
/// The name of the calling method, used for test file isolation and clean-up.
- public CleanRunHeadlessGameHost(string gameSuffix = @"", bool bindIPC = false, bool realtime = true, [CallerMemberName] string callingMethodName = @"")
- : base(callingMethodName + gameSuffix, bindIPC, realtime)
+ public CleanRunHeadlessGameHost(string gameSuffix = @"", bool bindIPC = false, bool realtime = true, bool bypassCleanup = false, [CallerMemberName] string callingMethodName = @"")
+ : base(callingMethodName + gameSuffix, bindIPC, realtime, bypassCleanup: bypassCleanup)
{
}