1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-24 11:38:00 +01:00

Merge pull request #598 from guusdk/sint_muc-occupant-race

[sinttest] Fix race condition in MUC test
This commit is contained in:
Florian Schmaus 2024-06-27 14:40:23 +00:00 committed by GitHub
commit 98ff4d8a65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -214,16 +214,15 @@ public class MultiUserChatOccupantIntegrationTest extends AbstractMultiUserChatI
final Resourcepart nicknameThree = Resourcepart.from("three-" + randomString);
createMuc(mucAsSeenByOne, nicknameOne);
mucAsSeenByTwo.join(nicknameTwo);
SimpleResultSyncPoint oneSeesTwo = new SimpleResultSyncPoint();
mucAsSeenByOne.addParticipantListener(presence -> {
if (nicknameTwo.equals(presence.getFrom().getResourceOrEmpty())) {
oneSeesTwo.signal();
}
});
mucAsSeenByOne.grantModerator(nicknameTwo);
mucAsSeenByTwo.join(nicknameTwo);
oneSeesTwo.waitForResult(timeout);
mucAsSeenByOne.grantModerator(nicknameTwo);
List<Presence> results = new ArrayList<>();
mucAsSeenByThree.addParticipantListener(results::add);