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:
commit
b13fa924fd
@ -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}",
|
||||
|
@ -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>();
|
||||
|
Loading…
Reference in New Issue
Block a user