From 7d404ede060063e0d05831401f37c25b9448be66 Mon Sep 17 00:00:00 2001 From: gnuxie Date: Tue, 3 May 2022 11:30:19 +0100 Subject: [PATCH] Extend default timeout in mocha --- package.json | 2 +- test/integration/banListTest.ts | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/package.json b/package.json index 889d815..2f7e363 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint": "tslint --project ./tsconfig.json -t stylish", "start:dev": "yarn build && node --async-stack-traces lib/index.js", "test": "ts-mocha --project ./tsconfig.json test/commands/**/*.ts", - "test:integration": "NODE_ENV=harness ts-mocha --async-stack-traces --require test/integration/fixtures.ts --project ./tsconfig.json \"test/integration/**/*Test.ts\"", + "test:integration": "NODE_ENV=harness ts-mocha --async-stack-traces --require test/integration/fixtures.ts --project ./tsconfig.json \"test/integration/**/*Test.ts\" --timeout 120000", "test:manual": "NODE_ENV=harness ts-node test/integration/manualLaunchScript.ts", "version": "sed -i '/# version automated/s/[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*/'$npm_package_version'/' synapse_antispam/setup.py && git add synapse_antispam/setup.py && cat synapse_antispam/setup.py" }, diff --git a/test/integration/banListTest.ts b/test/integration/banListTest.ts index a6bed47..2621cd1 100644 --- a/test/integration/banListTest.ts +++ b/test/integration/banListTest.ts @@ -28,7 +28,6 @@ async function createPolicyRule(client: MatrixClient, policyRoomId: string, poli describe("Test: Updating the BanList", function () { it("Calculates what has changed correctly.", async function () { - this.timeout(10000); const mjolnir = config.RUNTIME.client! const moderator = await newTestUser({ name: { contains: "moderator" }}); const banListId = await mjolnir.createRoom({ invite: [await moderator.getUserId()]}); @@ -119,7 +118,6 @@ describe("Test: Updating the BanList", function () { assert.equal(banList.userRules.filter(r => r.entity === '@old:localhost:9999').length, 1); }) it("Will remove rules with old types when they are 'soft redacted' with a different but more recent event type.", async function () { - this.timeout(3000); const mjolnir = config.RUNTIME.client! const moderator = await newTestUser({ name: { contains: "moderator" }}); const banListId = await mjolnir.createRoom({ invite: [await moderator.getUserId()]}); @@ -141,7 +139,6 @@ describe("Test: Updating the BanList", function () { assert.equal(banList.userRules.filter(rule => rule.entity === entity).length, 0, 'The rule should no longer be stored.'); }) it("A rule of the most recent type won't be deleted when an old rule is deleted for the same entity.", async function () { - this.timeout(3000); const mjolnir = config.RUNTIME.client! const moderator = await newTestUser({ name: { contains: "moderator" }}); const banListId = await mjolnir.createRoom({ invite: [await moderator.getUserId()]}); @@ -295,7 +292,6 @@ describe('Test: ACL updates will batch when rules are added in succession.', fun describe('Test: unbaning entities via the BanList.', function () { afterEach(function() { this.moderator?.stop(); }); it('Will remove rules that have legacy types', async function () { - this.timeout(20000) const mjolnir = config.RUNTIME.client! const serverName: string = new UserID(await mjolnir.getUserId()).domain const moderator = await newTestUser({ name: { contains: "moderator" }});