1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Merge pull request #13691 from peppy/throw-exceptions-on-host-failure

Fix multiple tests eating host exceptions
This commit is contained in:
Dan Balasescu 2021-06-29 18:05:47 +09:00 committed by GitHub
commit 3fb69666fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -17,7 +17,8 @@ namespace osu.Game.Tests
protected virtual TestOsuGameBase LoadOsuIntoHost(GameHost host, bool withBeatmap = false) protected virtual TestOsuGameBase LoadOsuIntoHost(GameHost host, bool withBeatmap = false)
{ {
var osu = new TestOsuGameBase(withBeatmap); var osu = new TestOsuGameBase(withBeatmap);
Task.Run(() => host.Run(osu)); Task.Run(() => host.Run(osu))
.ContinueWith(t => Assert.Fail($"Host threw exception {t.Exception}"), TaskContinuationOptions.OnlyOnFaulted);
waitForOrAssert(() => osu.IsLoaded, @"osu! failed to start in a reasonable amount of time"); waitForOrAssert(() => osu.IsLoaded, @"osu! failed to start in a reasonable amount of time");

View File

@ -149,7 +149,8 @@ namespace osu.Game.Tournament.Tests.NonVisual
private TournamentGameBase loadOsu(GameHost host) private TournamentGameBase loadOsu(GameHost host)
{ {
var osu = new TournamentGameBase(); var osu = new TournamentGameBase();
Task.Run(() => host.Run(osu)); Task.Run(() => host.Run(osu))
.ContinueWith(t => Assert.Fail($"Host threw exception {t.Exception}"), TaskContinuationOptions.OnlyOnFaulted);
waitForOrAssert(() => osu.IsLoaded, @"osu! failed to start in a reasonable amount of time"); waitForOrAssert(() => osu.IsLoaded, @"osu! failed to start in a reasonable amount of time");
return osu; return osu;
} }

View File

@ -55,7 +55,8 @@ namespace osu.Game.Tournament.Tests.NonVisual
private TournamentGameBase loadOsu(GameHost host) private TournamentGameBase loadOsu(GameHost host)
{ {
var osu = new TournamentGameBase(); var osu = new TournamentGameBase();
Task.Run(() => host.Run(osu)); Task.Run(() => host.Run(osu))
.ContinueWith(t => Assert.Fail($"Host threw exception {t.Exception}"), TaskContinuationOptions.OnlyOnFaulted);
waitForOrAssert(() => osu.IsLoaded, @"osu! failed to start in a reasonable amount of time"); waitForOrAssert(() => osu.IsLoaded, @"osu! failed to start in a reasonable amount of time");
return osu; return osu;
} }