1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Fix occasionally ChatOverlay test failures due to RNG usage

See https://github.com/ppy/osu/actions/runs/10302758137/job/28517150950.

Same ID gets chosen twice for PM channel.
This commit is contained in:
Dean Herbert 2024-08-09 17:37:39 +09:00
parent 45c1dfde5e
commit 0a8e342830
No known key found for this signature in database

View File

@ -717,9 +717,12 @@ namespace osu.Game.Tests.Visual.Online
Type = ChannelType.Public,
};
private static int privateChannelUser = DummyAPIAccess.DUMMY_USER_ID + 1;
private Channel createPrivateChannel()
{
int id = RNG.Next(0, DummyAPIAccess.DUMMY_USER_ID - 1);
int id = Interlocked.Increment(ref privateChannelUser);
return new Channel(new APIUser
{
Id = id,