mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Replace usage of TimeoutAttribute
to fix beatmap conversion test failures
This commit is contained in:
parent
f3e889d0f6
commit
f9713b8895
@ -14,7 +14,6 @@ using osu.Game.Tests.Beatmaps;
|
||||
namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
[Timeout(10000)]
|
||||
public class CatchBeatmapConversionTest : BeatmapConversionTest<ConvertValue>
|
||||
{
|
||||
protected override string ResourceAssembly => "osu.Game.Rulesets.Catch";
|
||||
|
@ -14,7 +14,6 @@ using osu.Game.Tests.Beatmaps;
|
||||
namespace osu.Game.Rulesets.Mania.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
[Timeout(10000)]
|
||||
public class ManiaBeatmapConversionTest : BeatmapConversionTest<ManiaConvertMapping, ConvertValue>
|
||||
{
|
||||
protected override string ResourceAssembly => "osu.Game.Rulesets.Mania";
|
||||
|
@ -12,7 +12,6 @@ using osu.Game.Tests.Beatmaps;
|
||||
namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
[Timeout(10000)]
|
||||
public class OsuBeatmapConversionTest : BeatmapConversionTest<ConvertValue>
|
||||
{
|
||||
protected override string ResourceAssembly => "osu.Game.Rulesets.Osu";
|
||||
|
@ -12,7 +12,6 @@ using osu.Game.Tests.Beatmaps;
|
||||
namespace osu.Game.Rulesets.Taiko.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
[Timeout(10000)]
|
||||
public class TaikoBeatmapConversionTest : BeatmapConversionTest<ConvertValue>
|
||||
{
|
||||
protected override string ResourceAssembly => "osu.Game.Rulesets.Taiko";
|
||||
|
@ -6,9 +6,11 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Extensions.ObjectExtensions;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Beatmaps;
|
||||
@ -107,6 +109,8 @@ namespace osu.Game.Tests.Beatmaps
|
||||
}
|
||||
|
||||
private ConvertResult convert(string name, Mod[] mods)
|
||||
{
|
||||
var conversionTask = Task.Factory.StartNew(() =>
|
||||
{
|
||||
var beatmap = GetBeatmap(name);
|
||||
|
||||
@ -139,6 +143,12 @@ namespace osu.Game.Tests.Beatmaps
|
||||
return mapping;
|
||||
}).ToList()
|
||||
};
|
||||
}, TaskCreationOptions.LongRunning);
|
||||
|
||||
if (!conversionTask.Wait(10000))
|
||||
Assert.Fail("Conversion timed out");
|
||||
|
||||
return conversionTask.WaitSafelyForResult();
|
||||
}
|
||||
|
||||
protected virtual void OnConversionGenerated(HitObject original, IEnumerable<HitObject> result, IBeatmapConverter beatmapConverter)
|
||||
|
Loading…
Reference in New Issue
Block a user