aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-17 16:42:57 +0200
committerChocobozzz <me@florianbigard.com>2023-05-17 16:43:05 +0200
commite901579b00fbcd8fc0f7b45fd841636329148a34 (patch)
tree9dcfb17e3004469c96904bfc7f2136eb4fbe637f
parentf86ff3a02642263ac64db5d5fba4059db0092561 (diff)
downloadPeerTube-e901579b00fbcd8fc0f7b45fd841636329148a34.tar.gz
PeerTube-e901579b00fbcd8fc0f7b45fd841636329148a34.tar.zst
PeerTube-e901579b00fbcd8fc0f7b45fd841636329148a34.zip
Fix tests
-rw-r--r--server/initializers/constants.ts5
-rw-r--r--server/lib/runners/runner.ts3
-rw-r--r--server/tests/api/check-params/video-captions.ts2
-rw-r--r--server/tests/api/notifications/moderation-notifications.ts2
-rw-r--r--server/tests/api/notifications/registrations-notifications.ts2
-rw-r--r--server/tests/api/search/search-videos.ts2
6 files changed, 10 insertions, 6 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 46455dd5b..85944fa3a 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -257,7 +257,8 @@ const JOB_REMOVAL_OPTIONS = {
257const VIDEO_IMPORT_TIMEOUT = Math.floor(JOB_TTL['video-import'] * 0.9) 257const VIDEO_IMPORT_TIMEOUT = Math.floor(JOB_TTL['video-import'] * 0.9)
258 258
259const RUNNER_JOBS = { 259const RUNNER_JOBS = {
260 MAX_FAILURES: 5 260 MAX_FAILURES: 5,
261 LAST_CONTACT_UPDATE_INTERVAL: 30000
261} 262}
262 263
263// --------------------------------------------------------------------------- 264// ---------------------------------------------------------------------------
@@ -1034,6 +1035,8 @@ if (process.env.PRODUCTION_CONSTANTS !== 'true') {
1034 VIDEO_LIVE.SEGMENT_TIME_SECONDS.DEFAULT_LATENCY = 2 1035 VIDEO_LIVE.SEGMENT_TIME_SECONDS.DEFAULT_LATENCY = 2
1035 VIDEO_LIVE.SEGMENT_TIME_SECONDS.SMALL_LATENCY = 1 1036 VIDEO_LIVE.SEGMENT_TIME_SECONDS.SMALL_LATENCY = 1
1036 VIDEO_LIVE.EDGE_LIVE_DELAY_SEGMENTS_NOTIFICATION = 1 1037 VIDEO_LIVE.EDGE_LIVE_DELAY_SEGMENTS_NOTIFICATION = 1
1038
1039 RUNNER_JOBS.LAST_CONTACT_UPDATE_INTERVAL = 2000
1037 } 1040 }
1038} 1041}
1039 1042
diff --git a/server/lib/runners/runner.ts b/server/lib/runners/runner.ts
index 5478ab519..921cae6f2 100644
--- a/server/lib/runners/runner.ts
+++ b/server/lib/runners/runner.ts
@@ -3,6 +3,7 @@ import { retryTransactionWrapper } from '@server/helpers/database-utils'
3import { logger, loggerTagsFactory } from '@server/helpers/logger' 3import { logger, loggerTagsFactory } from '@server/helpers/logger'
4import { sequelizeTypescript } from '@server/initializers/database' 4import { sequelizeTypescript } from '@server/initializers/database'
5import { MRunner } from '@server/types/models/runners' 5import { MRunner } from '@server/types/models/runners'
6import { RUNNER_JOBS } from '@server/initializers/constants'
6 7
7const lTags = loggerTagsFactory('runner') 8const lTags = loggerTagsFactory('runner')
8 9
@@ -12,7 +13,7 @@ function updateLastRunnerContact (req: express.Request, runner: MRunner) {
12 const now = new Date() 13 const now = new Date()
13 14
14 // Don't update last runner contact too often 15 // Don't update last runner contact too often
15 if (now.getTime() - runner.lastContact.getTime() < 30000) return 16 if (now.getTime() - runner.lastContact.getTime() < RUNNER_JOBS.LAST_CONTACT_UPDATE_INTERVAL) return
16 if (updatingRunner.has(runner.id)) return 17 if (updatingRunner.has(runner.id)) return
17 18
18 updatingRunner.add(runner.id) 19 updatingRunner.add(runner.id)
diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts
index bfce5ca47..532dab1c4 100644
--- a/server/tests/api/check-params/video-captions.ts
+++ b/server/tests/api/check-params/video-captions.ts
@@ -23,7 +23,7 @@ describe('Test video captions API validator', function () {
23 // --------------------------------------------------------------- 23 // ---------------------------------------------------------------
24 24
25 before(async function () { 25 before(async function () {
26 this.timeout(30000) 26 this.timeout(120000)
27 27
28 server = await createSingleServer(1) 28 server = await createSingleServer(1)
29 29
diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts
index fa75182e1..d80de821e 100644
--- a/server/tests/api/notifications/moderation-notifications.ts
+++ b/server/tests/api/notifications/moderation-notifications.ts
@@ -33,7 +33,7 @@ describe('Test moderation notifications', function () {
33 let emails: object[] = [] 33 let emails: object[] = []
34 34
35 before(async function () { 35 before(async function () {
36 this.timeout(50000) 36 this.timeout(120000)
37 37
38 const res = await prepareNotificationsTest(3) 38 const res = await prepareNotificationsTest(3)
39 emails = res.emails 39 emails = res.emails
diff --git a/server/tests/api/notifications/registrations-notifications.ts b/server/tests/api/notifications/registrations-notifications.ts
index b5a7c2bb5..d20fc8df3 100644
--- a/server/tests/api/notifications/registrations-notifications.ts
+++ b/server/tests/api/notifications/registrations-notifications.ts
@@ -21,7 +21,7 @@ describe('Test registrations notifications', function () {
21 let baseParams: CheckerBaseParams 21 let baseParams: CheckerBaseParams
22 22
23 before(async function () { 23 before(async function () {
24 this.timeout(50000) 24 this.timeout(120000)
25 25
26 const res = await prepareNotificationsTest(1) 26 const res = await prepareNotificationsTest(1)
27 27
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts
index 5e85e3aa7..66c462942 100644
--- a/server/tests/api/search/search-videos.ts
+++ b/server/tests/api/search/search-videos.ts
@@ -26,7 +26,7 @@ describe('Test videos search', function () {
26 let command: SearchCommand 26 let command: SearchCommand
27 27
28 before(async function () { 28 before(async function () {
29 this.timeout(240000) 29 this.timeout(360000)
30 30
31 const servers = await Promise.all([ 31 const servers = await Promise.all([
32 createSingleServer(1), 32 createSingleServer(1),