diff options
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/real-world/populate-database.ts | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/server/tests/real-world/populate-database.ts b/server/tests/real-world/populate-database.ts index f0f82f7f8..d41ac8d36 100644 --- a/server/tests/real-world/populate-database.ts +++ b/server/tests/real-world/populate-database.ts | |||
@@ -38,15 +38,26 @@ async function start () { | |||
38 | 38 | ||
39 | // Forever | 39 | // Forever |
40 | const fakeTab = Array.from(Array(1000000).keys()) | 40 | const fakeTab = Array.from(Array(1000000).keys()) |
41 | await Bluebird.map(fakeTab, () => { | 41 | const funs = [ |
42 | return Promise.all([ | 42 | uploadCustom |
43 | uploadCustom(server), | 43 | // uploadCustom, |
44 | likeCustom(server), | 44 | // uploadCustom, |
45 | dislikeCustom(server), | 45 | // uploadCustom, |
46 | createUserCustom(server), | 46 | // likeCustom, |
47 | createCustomChannel(server) | 47 | // createUserCustom, |
48 | ]).catch(err => console.error(err)) | 48 | // createCustomChannel |
49 | }, { concurrency: 5 }) | 49 | ] |
50 | const promises = [] | ||
51 | |||
52 | for (const fun of funs) { | ||
53 | promises.push( | ||
54 | Bluebird.map(fakeTab, () => { | ||
55 | return fun(server).catch(err => console.error(err)) | ||
56 | }, { concurrency: 3 }) | ||
57 | ) | ||
58 | } | ||
59 | |||
60 | await Promise.all(promises) | ||
50 | } | 61 | } |
51 | 62 | ||
52 | function getRandomInt (min, max) { | 63 | function getRandomInt (min, max) { |