aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/server/stats.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts
index 0e77712cf..9f785a80e 100644
--- a/server/tests/api/server/stats.ts
+++ b/server/tests/api/server/stats.ts
@@ -176,6 +176,32 @@ describe('Test stats (excluding redundancy)', function () {
176 } 176 }
177 }) 177 })
178 178
179 it('Should have the correct AP stats', async function () {
180 this.timeout(60000)
181
182 for (let i = 0; i < 10; i++) {
183 await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video' })
184 }
185
186 const res1 = await getStats(servers[1].url)
187 const first = res1.body as ServerStats
188
189 await waitJobs(servers)
190
191 const res2 = await getStats(servers[1].url)
192 const second: ServerStats = res2.body
193
194 expect(second.totalActivityPubMessagesWaiting).to.equal(0)
195 expect(second.totalActivityPubMessagesProcessed).to.be.greaterThan(first.totalActivityPubMessagesProcessed)
196
197 await wait(5000)
198
199 const res3 = await getStats(servers[1].url)
200 const third: ServerStats = res3.body
201
202 expect(third.activityPubMessagesProcessedPerSecond).to.be.lessThan(second.activityPubMessagesProcessedPerSecond)
203 })
204
179 after(async function () { 205 after(async function () {
180 await cleanupTests(servers) 206 await cleanupTests(servers)
181 }) 207 })