Skip to content

Commit

Permalink
Completed (#33)
Browse files Browse the repository at this point in the history
* Keep a smaller amount of jobs

* moar
  • Loading branch information
soulgalore committed Jun 26, 2024
1 parent c77a897 commit bf031bf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
8 changes: 4 additions & 4 deletions server/src/util/add-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ export async function addTest(request) {
},
{
jobId,
removeOnComplete: 3600,
removeOnFail: 3600,
removeOnComplete: 200,
removeOnFail: 400,
priority
}
);
Expand Down Expand Up @@ -199,8 +199,8 @@ export async function addTestFromAPI(

const jobConfig = {
jobId,
removeOnComplete: 3600,
removeOnFail: 3600,
removeOnComplete: 200,
removeOnFail: 400,
priority: priority || 10
};

Expand Down
18 changes: 12 additions & 6 deletions testrunner/src/testrunners/docker-testrunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
18 changes: 12 additions & 6 deletions testrunner/src/testrunners/testrunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand Down

0 comments on commit bf031bf

Please sign in to comment.