mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 04:32:57 +08:00
Add timeout for all ManualResetEventSlim.Wait
invocations
Timeout values were taken as best-guesses of upper values we'd expect from sane execution.
This commit is contained in:
parent
ed9c55a776
commit
7ef8b7df5f
@ -76,7 +76,7 @@ namespace osu.Game.Benchmarks
|
||||
}
|
||||
});
|
||||
|
||||
done.Wait();
|
||||
done.Wait(60000);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
@ -115,7 +115,7 @@ namespace osu.Game.Benchmarks
|
||||
}
|
||||
});
|
||||
|
||||
done.Wait();
|
||||
done.Wait(60000);
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
|
@ -79,11 +79,11 @@ namespace osu.Game.Tests.Database
|
||||
{
|
||||
hasThreadedUsage.Set();
|
||||
|
||||
stopThreadedUsage.Wait();
|
||||
stopThreadedUsage.Wait(60000);
|
||||
});
|
||||
}, TaskCreationOptions.LongRunning | TaskCreationOptions.HideScheduler);
|
||||
|
||||
hasThreadedUsage.Wait();
|
||||
hasThreadedUsage.Wait(60000);
|
||||
|
||||
Assert.Throws<TimeoutException>(() =>
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
allowResponseCallback.Wait();
|
||||
allowResponseCallback.Wait(10000);
|
||||
allowResponseCallback.Reset();
|
||||
Schedule(() => d?.Invoke("Incorrect password"));
|
||||
});
|
||||
|
@ -209,6 +209,6 @@ namespace osu.Game.Database
|
||||
|
||||
public void SetMigrationCompletion() => migrationComplete.Set();
|
||||
|
||||
public void WaitForMigrationCompletion() => migrationComplete.Wait();
|
||||
public void WaitForMigrationCompletion() => migrationComplete.Wait(300000);
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ namespace osu.Game.Graphics
|
||||
framesWaitedEvent.Set();
|
||||
}, 10, true);
|
||||
|
||||
framesWaitedEvent.Wait();
|
||||
framesWaitedEvent.Wait(1000);
|
||||
waitDelegate.Cancel();
|
||||
}
|
||||
}
|
||||
|
@ -451,7 +451,8 @@ namespace osu.Game
|
||||
readyToRun.Set();
|
||||
}, false);
|
||||
|
||||
readyToRun.Wait();
|
||||
if (!readyToRun.Wait(30000))
|
||||
throw new TimeoutException("Attempting to block for migration took too long.");
|
||||
|
||||
bool? cleanupSucceded = (Storage as OsuStorage)?.Migrate(Host.GetStorage(path));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user