import 'mocha'
import * as chai from 'chai'
-import { HttpStatusCode } from '@shared/core-utils'
+import { completeVideoCheck } from '@server/tests/shared'
+import { wait } from '@shared/core-utils'
+import { HttpStatusCode, JobState, VideoCreateResult, VideoPrivacy } from '@shared/models'
import {
cleanupTests,
CommentsCommand,
- completeVideoCheck,
- flushAndRunMultipleServers,
+ createMultipleServers,
killallServers,
- reRunServer,
- ServerInfo,
+ PeerTubeServer,
setAccessTokensToServers,
- wait,
waitJobs
-} from '@shared/extra-utils'
-import { JobState, VideoCreateResult, VideoPrivacy } from '@shared/models'
+} from '@shared/server-commands'
const expect = chai.expect
describe('Test handle downs', function () {
- let servers: ServerInfo[] = []
+ let servers: PeerTubeServer[] = []
let threadIdServer1: number
let threadIdServer2: number
let commentIdServer1: number
let commentCommands: CommentsCommand[]
before(async function () {
- this.timeout(30000)
+ this.timeout(120000)
- servers = await flushAndRunMultipleServers(3)
+ servers = await createMultipleServers(3)
commentCommands = servers.map(s => s.comments)
checkAttributes = {
this.timeout(240000)
// Server 2 and 3 follow server 1
- await servers[1].follows.follow({ targets: [ servers[0].url ] })
- await servers[2].follows.follow({ targets: [ servers[0].url ] })
+ await servers[1].follows.follow({ hosts: [ servers[0].url ] })
+ await servers[2].follows.follow({ hosts: [ servers[0].url ] })
await waitJobs(servers)
const states: JobState[] = [ 'waiting', 'active' ]
for (const state of states) {
- const body = await servers[0].jobs.getJobsList({
+ const body = await servers[0].jobs.list({
state: state,
start: 0,
count: 50,
})
it('Should re-follow server 1', async function () {
- this.timeout(35000)
+ this.timeout(70000)
- await reRunServer(servers[1])
- await reRunServer(servers[2])
+ await servers[1].run()
+ await servers[2].run()
await servers[1].follows.unfollow({ target: servers[0] })
await waitJobs(servers)
- await servers[1].follows.follow({ targets: [ servers[0].url ] })
+ await servers[1].follows.follow({ hosts: [ servers[0].url ] })
await waitJobs(servers)