Fix tests

pull/5817/head
Chocobozzz 2023-05-17 16:42:57 +02:00
parent f86ff3a026
commit e901579b00
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
6 changed files with 10 additions and 6 deletions

View File

@ -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
}
}

View File

@ -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)

View File

@ -23,7 +23,7 @@ describe('Test video captions API validator', function () {
// ---------------------------------------------------------------
before(async function () {
this.timeout(30000)
this.timeout(120000)
server = await createSingleServer(1)

View File

@ -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

View File

@ -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)

View File

@ -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),