From 3cd0734fd9b0ff21aaef02317a874e8f1c06e027 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 13 Jun 2018 10:06:50 +0200 Subject: Improve tests when waiting pending jobs --- server/tests/cli/update-host.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'server/tests/cli/update-host.ts') diff --git a/server/tests/cli/update-host.ts b/server/tests/cli/update-host.ts index ad56f7b1b..d0c6d2042 100644 --- a/server/tests/cli/update-host.ts +++ b/server/tests/cli/update-host.ts @@ -3,22 +3,22 @@ import 'mocha' import * as chai from 'chai' import { VideoDetails } from '../../../shared/models/videos' -const expect = chai.expect - import { execCLI, flushTests, getEnvCli, + getVideo, getVideosList, killallServers, parseTorrentVideo, runServer, ServerInfo, setAccessTokensToServers, - uploadVideo, - wait, - getVideo + uploadVideo } from '../utils' +import { waitJobs } from '../utils/server/jobs' + +const expect = chai.expect describe('Test update host scripts', function () { let server: ServerInfo @@ -41,7 +41,8 @@ describe('Test update host scripts', function () { const videoAttributes = {} await uploadVideo(server.url, server.accessToken, videoAttributes) await uploadVideo(server.url, server.accessToken, videoAttributes) - await wait(30000) + + await waitJobs(server) }) it('Should update torrent hosts', async function () { @@ -82,10 +83,5 @@ describe('Test update host scripts', function () { after(async function () { killallServers([ server ]) - - // Keep the logs if the test failed - if (this['ok']) { - await flushTests() - } }) }) -- cgit v1.2.3