add more time in tests

This commit is contained in:
H. Shay 2024-09-30 13:38:00 -07:00
parent c269984bb7
commit c8b36347d0
3 changed files with 4 additions and 3 deletions

View File

@ -295,7 +295,7 @@ describe('Test: ACL updates will batch when rules are added in succession.', fun
// If there's less than two then it means the ACL was updated by this test calling `this.mjolnir!.syncLists()`
// and not the listener that detects changes to ban lists (that we want to test!).
// It used to be 10, but it was too low, 30 seems better for CI.
assert.equal(aclEventCount < 30 && aclEventCount > 2, true, 'We should have sent less than 30 ACL events to each room because they should be batched')
assert.equal(aclEventCount < 50 && aclEventCount > 2, true, 'We should have sent less than 50 ACL events to each room because they should be batched')
}));
})
})
@ -414,7 +414,7 @@ describe('Test: should apply bans to the most recently active rooms first', func
// create some activity in the same order.
for (const roomId of protectedRooms.slice().reverse()) {
await moderator.sendMessage(roomId, { body: `activity`, msgtype: 'm.text' });
await new Promise(resolve => setTimeout(resolve, 100));
await new Promise(resolve => setTimeout(resolve, 500));
}
// check the rooms are in the expected order

View File

@ -34,7 +34,7 @@ describe("Test: The make admin command", function () {
await moderator.sendMessage(this.mjolnir.managementRoomId, { msgtype: 'm.text.', body: `!mjolnir rooms add ${targetRoom}` });
LogService.debug("makeadminTest", `Adding targetRoom: ${targetRoom}`);
// allow bot time to join room
await new Promise(resolve => setTimeout(resolve, 1000));
await new Promise(resolve => setTimeout(resolve, 5000));
try {
await moderator.start();
await userA.start();

View File

@ -144,6 +144,7 @@ describe("Test: Protection settings", function() {
settings = { test: new StringProtectionSetting() };
});
await new Promise(resolve => setTimeout(resolve, 5000));
let replyPromise: Promise<any> = new Promise((resolve, reject) => {
let i = 0;
client.on('room.message', noticeListener(this.mjolnir.managementRoomId, (event) => {