diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-20 16:24:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-20 16:24:31 +0200 |
commit | 0491173a61aed66205c017e0d7e0503ea316c144 (patch) | |
tree | ce6621597505f9518cfdf0981977d097c63f9fad /server/tests/utils | |
parent | 8704acf49efc770d73bf07c10468ed8c74d28a83 (diff) | |
parent | 6247b2057b792cea155a1abd9788c363ae7d2cc2 (diff) | |
download | PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.gz PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.zst PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.zip |
Merge branch 'develop' into cli-wrapper
Diffstat (limited to 'server/tests/utils')
-rw-r--r-- | server/tests/utils/server/servers.ts | 7 | ||||
-rw-r--r-- | server/tests/utils/server/stats.ts | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/server/tests/utils/server/servers.ts b/server/tests/utils/server/servers.ts index 1372c03c3..26ab4e1bb 100644 --- a/server/tests/utils/server/servers.ts +++ b/server/tests/utils/server/servers.ts | |||
@@ -35,7 +35,7 @@ interface ServerInfo { | |||
35 | } | 35 | } |
36 | } | 36 | } |
37 | 37 | ||
38 | function flushAndRunMultipleServers (totalServers) { | 38 | function flushAndRunMultipleServers (totalServers: number, configOverride?: Object) { |
39 | let apps = [] | 39 | let apps = [] |
40 | let i = 0 | 40 | let i = 0 |
41 | 41 | ||
@@ -51,10 +51,7 @@ function flushAndRunMultipleServers (totalServers) { | |||
51 | flushTests() | 51 | flushTests() |
52 | .then(() => { | 52 | .then(() => { |
53 | for (let j = 1; j <= totalServers; j++) { | 53 | for (let j = 1; j <= totalServers; j++) { |
54 | // For the virtual buffer | 54 | runServer(j, configOverride).then(app => anotherServerDone(j, app)) |
55 | setTimeout(() => { | ||
56 | runServer(j).then(app => anotherServerDone(j, app)) | ||
57 | }, 1000 * (j - 1)) | ||
58 | } | 55 | } |
59 | }) | 56 | }) |
60 | }) | 57 | }) |
diff --git a/server/tests/utils/server/stats.ts b/server/tests/utils/server/stats.ts index 9cdec6cff..01989d952 100644 --- a/server/tests/utils/server/stats.ts +++ b/server/tests/utils/server/stats.ts | |||
@@ -1,11 +1,16 @@ | |||
1 | import { makeGetRequest } from '../' | 1 | import { makeGetRequest } from '../' |
2 | 2 | ||
3 | function getStats (url: string) { | 3 | function getStats (url: string, useCache = false) { |
4 | const path = '/api/v1/server/stats' | 4 | const path = '/api/v1/server/stats' |
5 | 5 | ||
6 | const query = { | ||
7 | t: useCache ? undefined : new Date().getTime() | ||
8 | } | ||
9 | |||
6 | return makeGetRequest({ | 10 | return makeGetRequest({ |
7 | url, | 11 | url, |
8 | path, | 12 | path, |
13 | query, | ||
9 | statusCodeExpected: 200 | 14 | statusCodeExpected: 200 |
10 | }) | 15 | }) |
11 | } | 16 | } |