From bf031bfa2fd239982d1d1440b7db60e05aba7032 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Wed, 26 Jun 2024 05:29:48 +0200 Subject: [PATCH] Completed (#33) * Keep a smaller amount of jobs * moar --- server/src/util/add-test.js | 8 ++++---- .../src/testrunners/docker-testrunner.js | 18 ++++++++++++------ testrunner/src/testrunners/testrunner.js | 18 ++++++++++++------ 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/server/src/util/add-test.js b/server/src/util/add-test.js index dd82258..85d322f 100644 --- a/server/src/util/add-test.js +++ b/server/src/util/add-test.js @@ -139,8 +139,8 @@ export async function addTest(request) { }, { jobId, - removeOnComplete: 3600, - removeOnFail: 3600, + removeOnComplete: 200, + removeOnFail: 400, priority } ); @@ -199,8 +199,8 @@ export async function addTestFromAPI( const jobConfig = { jobId, - removeOnComplete: 3600, - removeOnFail: 3600, + removeOnComplete: 200, + removeOnFail: 400, priority: priority || 10 }; diff --git a/testrunner/src/testrunners/docker-testrunner.js b/testrunner/src/testrunners/docker-testrunner.js index 184b301..e35b0a4 100644 --- a/testrunner/src/testrunners/docker-testrunner.js +++ b/testrunner/src/testrunners/docker-testrunner.js @@ -95,12 +95,18 @@ export default async function runJob(job) { runTime = testResult.result.browsertime[0].info.timestamp; } - resultQueue.add({ - result: testResult.result, - id: job.id, - status: testResult.exitCode === 0 ? 'completed' : 'failed', - runTime - }); + resultQueue.add( + { + result: testResult.result, + id: job.id, + status: testResult.exitCode === 0 ? 'completed' : 'failed', + runTime + }, + { + removeOnComplete: 200, + removeOnFail: 200 + } + ); if (testResult.exitCode > 0) { throw new Error( diff --git a/testrunner/src/testrunners/testrunner.js b/testrunner/src/testrunners/testrunner.js index 74ac422..ef84836 100644 --- a/testrunner/src/testrunners/testrunner.js +++ b/testrunner/src/testrunners/testrunner.js @@ -42,12 +42,18 @@ export default async function runJob(job) { // The timestamp from Browsertime is more exact runTime = testResult.result.browsertime[0].info.timestamp; } - resultQueue.add({ - result: testResult.result, - id: job.id, - status: testResult.exitCode === 0 ? 'completed' : 'failed', - runTime - }); + resultQueue.add( + { + result: testResult.result, + id: job.id, + status: testResult.exitCode === 0 ? 'completed' : 'failed', + runTime + }, + { + removeOnComplete: 200, + removeOnFail: 200 + } + ); if (testResult.exitCode > 0) { throw new Error( `sitespeed.io exited with a failure exit code ${testResult.exitCode}`