Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix tests

Chocobozzze901579b00fb
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 46455dd5be..85944fa3a4 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -257,7 +257,8 @@ const JOB_REMOVAL_OPTIONS = {
const VIDEO_IMPORT_TIMEOUT = Math.floor(JOB_TTL['video-import'] * 0.9)
const RUNNER_JOBS = {
- MAX_FAILURES: 5
+ MAX_FAILURES: 5,
+ LAST_CONTACT_UPDATE_INTERVAL: 30000
}
// ---------------------------------------------------------------------------
@@ -1034,6 +1035,8 @@ if (process.env.PRODUCTION_CONSTANTS !== 'true') {
VIDEO_LIVE.SEGMENT_TIME_SECONDS.DEFAULT_LATENCY = 2
VIDEO_LIVE.SEGMENT_TIME_SECONDS.SMALL_LATENCY = 1
VIDEO_LIVE.EDGE_LIVE_DELAY_SEGMENTS_NOTIFICATION = 1
+
+ RUNNER_JOBS.LAST_CONTACT_UPDATE_INTERVAL = 2000
}
}
diff --git a/server/lib/runners/runner.ts b/server/lib/runners/runner.ts
index 5478ab519a..921cae6f22 100644
--- a/server/lib/runners/runner.ts
+++ b/server/lib/runners/runner.ts
@@ -3,6 +3,7 @@ import { retryTransactionWrapper } from '@server/helpers/database-utils'
import { logger, loggerTagsFactory } from '@server/helpers/logger'
import { sequelizeTypescript } from '@server/initializers/database'
import { MRunner } from '@server/types/models/runners'
+import { RUNNER_JOBS } from '@server/initializers/constants'
const lTags = loggerTagsFactory('runner')
@@ -12,7 +13,7 @@ function updateLastRunnerContact (req: express.Request, runner: MRunner) {
const now = new Date()
// Don't update last runner contact too often
- if (now.getTime() - runner.lastContact.getTime() < 30000) return
+ if (now.getTime() - runner.lastContact.getTime() < RUNNER_JOBS.LAST_CONTACT_UPDATE_INTERVAL) return
if (updatingRunner.has(runner.id)) return
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 bfce5ca476..532dab1c49 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 () {
// ---------------------------------------------------------------
before(async function () {
- this.timeout(30000)
+ this.timeout(120000)
server = await createSingleServer(1)
diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts
index fa75182e15..d80de821e4 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 () {
let emails: object[] = []
before(async function () {
- this.timeout(50000)
+ this.timeout(120000)
const res = await prepareNotificationsTest(3)
emails = res.emails
diff --git a/server/tests/api/notifications/registrations-notifications.ts b/server/tests/api/notifications/registrations-notifications.ts
index b5a7c2bb56..d20fc8df36 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 () {
let baseParams: CheckerBaseParams
before(async function () {
- this.timeout(50000)
+ this.timeout(120000)
const res = await prepareNotificationsTest(1)
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts
index 5e85e3aa77..66c462942f 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 () {
let command: SearchCommand
before(async function () {
- this.timeout(240000)
+ this.timeout(360000)
const servers = await Promise.all([
createSingleServer(1),