mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Protect against test failures due to logger being set too early (and beginning logging)
This commit is contained in:
@ -26,7 +26,14 @@ namespace osu.Game.Tests
|
||||
|
||||
protected override void SetupForRun()
|
||||
{
|
||||
Storage.DeleteDirectory(string.Empty);
|
||||
try
|
||||
{
|
||||
Storage.DeleteDirectory(string.Empty);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// May fail if a logging target has already been set via OsuStorage.ChangeTargetStorage.
|
||||
}
|
||||
|
||||
// base call needs to be run *after* storage is emptied, as it updates the (static) logger's storage and may start writing
|
||||
// log entries from another source if a unit test host is shared over multiple tests, causing a file access denied exception.
|
||||
|
Reference in New Issue
Block a user