Fix tests
This commit is contained in:
parent
9e847c17f9
commit
0fbc0dec59
4 changed files with 21 additions and 12 deletions
|
@ -150,7 +150,7 @@ async function updateVideo (req: express.Request, res: express.Response) {
|
|||
|
||||
if (videoInfoToUpdate.name) await updateTorrentsMetadata(videoInstanceUpdated)
|
||||
|
||||
await federateVideoIfNeeded(videoInstanceUpdated, isNewVideo, undefined)
|
||||
await sequelizeTypescript.transaction(t => federateVideoIfNeeded(videoInstanceUpdated, isNewVideo, t))
|
||||
|
||||
if (wasConfidentialVideo) Notifier.Instance.notifyOnNewVideoIfNeeded(videoInstanceUpdated)
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ describe('Test videos redundancy', function () {
|
|||
const strategy = 'most-views'
|
||||
|
||||
before(function () {
|
||||
this.timeout(120000)
|
||||
this.timeout(240000)
|
||||
|
||||
return createServers(strategy)
|
||||
})
|
||||
|
@ -357,7 +357,7 @@ describe('Test videos redundancy', function () {
|
|||
const strategy = 'trending'
|
||||
|
||||
before(function () {
|
||||
this.timeout(120000)
|
||||
this.timeout(240000)
|
||||
|
||||
return createServers(strategy)
|
||||
})
|
||||
|
@ -420,7 +420,7 @@ describe('Test videos redundancy', function () {
|
|||
const strategy = 'recently-added'
|
||||
|
||||
before(function () {
|
||||
this.timeout(120000)
|
||||
this.timeout(240000)
|
||||
|
||||
return createServers(strategy, { min_views: 3 })
|
||||
})
|
||||
|
@ -491,7 +491,7 @@ describe('Test videos redundancy', function () {
|
|||
const strategy = 'recently-added'
|
||||
|
||||
before(async function () {
|
||||
this.timeout(120000)
|
||||
this.timeout(240000)
|
||||
|
||||
await createServers(strategy, { min_views: 3 }, false)
|
||||
})
|
||||
|
@ -553,7 +553,7 @@ describe('Test videos redundancy', function () {
|
|||
|
||||
describe('With manual strategy', function () {
|
||||
before(function () {
|
||||
this.timeout(120000)
|
||||
this.timeout(240000)
|
||||
|
||||
return createServers(null)
|
||||
})
|
||||
|
@ -632,7 +632,7 @@ describe('Test videos redundancy', function () {
|
|||
}
|
||||
|
||||
before(async function () {
|
||||
this.timeout(120000)
|
||||
this.timeout(240000)
|
||||
|
||||
await createServers(strategy, { min_lifetime: '7 seconds', min_views: 0 })
|
||||
|
||||
|
@ -674,7 +674,7 @@ describe('Test videos redundancy', function () {
|
|||
const strategy = 'recently-added'
|
||||
|
||||
before(async function () {
|
||||
this.timeout(120000)
|
||||
this.timeout(240000)
|
||||
|
||||
await createServers(strategy, { min_lifetime: '7 seconds', min_views: 0 })
|
||||
|
||||
|
@ -698,7 +698,7 @@ describe('Test videos redundancy', function () {
|
|||
})
|
||||
|
||||
it('Should cache video 2 webseeds on the first video', async function () {
|
||||
this.timeout(120000)
|
||||
this.timeout(240000)
|
||||
|
||||
await waitJobs(servers)
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ describe('Test emails', function () {
|
|||
this.timeout(10000)
|
||||
|
||||
const reason = 'my super bad reason'
|
||||
await server.abuses.report({ videoId, reason })
|
||||
await server.abuses.report({ token: userAccessToken, videoId, reason })
|
||||
|
||||
await waitJobs(server)
|
||||
expect(emails).to.have.lengthOf(3)
|
||||
|
|
|
@ -2,7 +2,15 @@
|
|||
|
||||
import 'mocha'
|
||||
import * as chai from 'chai'
|
||||
import { cleanupTests, createSingleServer, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
|
||||
import {
|
||||
cleanupTests,
|
||||
createSingleServer,
|
||||
doubleFollow,
|
||||
PeerTubeServer,
|
||||
setAccessTokensToServers,
|
||||
wait,
|
||||
waitJobs
|
||||
} from '@shared/extra-utils'
|
||||
import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
|
||||
|
||||
const expect = chai.expect
|
||||
|
@ -209,7 +217,7 @@ describe('Test video privacy', function () {
|
|||
describe('Privacy update', function () {
|
||||
|
||||
it('Should update the private and internal videos to public on server 1', async function () {
|
||||
this.timeout(10000)
|
||||
this.timeout(100000)
|
||||
|
||||
now = Date.now()
|
||||
|
||||
|
@ -230,6 +238,7 @@ describe('Test video privacy', function () {
|
|||
await servers[0].videos.update({ id: internalVideoId, attributes })
|
||||
}
|
||||
|
||||
await wait(10000)
|
||||
await waitJobs(servers)
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue