Skip to content

Commit

Permalink
add more time in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay committed Sep 30, 2024
1 parent c269984 commit c8b3634
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/integration/banListTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}));
})
})
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/integration/commands/makedminCommandTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions test/integration/protectionSettingsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit c8b3634

Please sign in to comment.