From 6a9b3151822461a85bbc72b7a50e12ffb69bec3a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 22 May 2023 14:31:35 +0200 Subject: Fix tests --- server/lib/live/live-segment-sha-store.ts | 2 ++ server/tests/api/check-params/runners.ts | 16 ---------------- server/tests/api/live/live-constraints.ts | 11 +++++++++-- 3 files changed, 11 insertions(+), 18 deletions(-) (limited to 'server') diff --git a/server/lib/live/live-segment-sha-store.ts b/server/lib/live/live-segment-sha-store.ts index 1a0a93985..08fc460b8 100644 --- a/server/lib/live/live-segment-sha-store.ts +++ b/server/lib/live/live-segment-sha-store.ts @@ -72,6 +72,8 @@ class LiveSegmentShaStore { private writeToDisk () { return this.writeQueue.add(async () => { + logger.debug(`Writing segment sha JSON ${this.sha256Path} of ${this.videoUUID} on disk %s.`, lTags(this.videoUUID)) + // Atomic write: use rename instead of move that is not atomic await writeJson(this.sha256PathTMP, mapToJSON(this.segmentsSha256)) await rename(this.sha256PathTMP, this.sha256Path) diff --git a/server/tests/api/check-params/runners.ts b/server/tests/api/check-params/runners.ts index cee1993e6..48821b678 100644 --- a/server/tests/api/check-params/runners.ts +++ b/server/tests/api/check-params/runners.ts @@ -674,22 +674,6 @@ describe('Test managing runners', function () { await testUpdate({ ...base, type: undefined }) await testUpdate({ ...base, type: 'toto' as any }) }) - - it('Should succeed with the correct params', async function () { - await server.runnerJobs.update({ - jobUUID: liveAcceptedJob.uuid, - jobToken: liveAcceptedJob.jobToken, - payload: base, - runnerToken - }) - - await server.runnerJobs.update({ - jobUUID: liveAcceptedJob.uuid, - jobToken: liveAcceptedJob.jobToken, - payload: { ...base, masterPlaylistFile: undefined }, - runnerToken - }) - }) }) }) diff --git a/server/tests/api/live/live-constraints.ts b/server/tests/api/live/live-constraints.ts index 37fd5b2a6..168241b79 100644 --- a/server/tests/api/live/live-constraints.ts +++ b/server/tests/api/live/live-constraints.ts @@ -173,6 +173,8 @@ describe('Test live constraints', function () { await servers[0].live.waitUntilPublished({ videoId: userVideoLiveoId }) + const baseQuota = await servers[0].users.getMyQuotaUsed({ token: userAccessToken }) + await wait(3000) const quotaUser = await servers[0].users.getMyQuotaUsed({ token: userAccessToken }) @@ -180,11 +182,16 @@ describe('Test live constraints', function () { const { data } = await servers[0].users.list() const quotaAdmin = data.find(u => u.username === 'user1') - expect(quotaUser.videoQuotaUsed).to.equal(quotaAdmin.videoQuotaUsed) - expect(quotaUser.videoQuotaUsedDaily).to.equal(quotaAdmin.videoQuotaUsedDaily) + expect(quotaUser.videoQuotaUsed).to.be.above(baseQuota.videoQuotaUsed) + expect(quotaUser.videoQuotaUsedDaily).to.be.above(baseQuota.videoQuotaUsedDaily) + + expect(quotaAdmin.videoQuotaUsed).to.be.above(baseQuota.videoQuotaUsed) + expect(quotaAdmin.videoQuotaUsedDaily).to.be.above(baseQuota.videoQuotaUsedDaily) expect(quotaUser.videoQuotaUsed).to.be.above(10) expect(quotaUser.videoQuotaUsedDaily).to.be.above(10) + expect(quotaAdmin.videoQuotaUsed).to.be.above(10) + expect(quotaAdmin.videoQuotaUsedDaily).to.be.above(10) await stopFfmpeg(ffmpegCommand) }) -- cgit v1.2.3