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

Merge pull request #18865 from peppy/fix-flaky-chat-test

Fix chat tests failing 1/10000 runs
This commit is contained in:
Dan Balasescu 2022-06-27 18:06:00 +09:00 committed by GitHub
commit b13fa924fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -549,7 +549,7 @@ namespace osu.Game.Tests.Visual.Online
private Channel createPrivateChannel()
{
int id = RNG.Next(0, 10000);
int id = RNG.Next(0, DummyAPIAccess.DUMMY_USER_ID - 1);
return new Channel(new APIUser
{
Id = id,
@ -559,7 +559,7 @@ namespace osu.Game.Tests.Visual.Online
private Channel createAnnounceChannel()
{
int id = RNG.Next(0, 10000);
int id = RNG.Next(0, DummyAPIAccess.DUMMY_USER_ID - 1);
return new Channel
{
Name = $"Announce {id}",

View File

@ -15,10 +15,12 @@ namespace osu.Game.Online.API
{
public class DummyAPIAccess : Component, IAPIProvider
{
public const int DUMMY_USER_ID = 1001;
public Bindable<APIUser> LocalUser { get; } = new Bindable<APIUser>(new APIUser
{
Username = @"Dummy",
Id = 1001,
Id = DUMMY_USER_ID,
});
public BindableList<APIUser> Friends { get; } = new BindableList<APIUser>();