From 1c77b2bbd5be14862094c21d23881a714dafc160 Mon Sep 17 00:00:00 2001 From: Phil Renaud Date: Fri, 6 Dec 2024 16:40:01 -0500 Subject: [PATCH] Added to aggregateAllocStatus acceptance test and changelog --- .changelog/24620.txt | 3 +++ ui/tests/acceptance/jobs-list-test.js | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changelog/24620.txt diff --git a/.changelog/24620.txt b/.changelog/24620.txt new file mode 100644 index 00000000000..f9c4c07e838 --- /dev/null +++ b/.changelog/24620.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fix an issue where system jobs with garbage-collected allocations were showing as Scaled Down +``` diff --git a/ui/tests/acceptance/jobs-list-test.js b/ui/tests/acceptance/jobs-list-test.js index 19843a9bc8a..f8fee25f5a1 100644 --- a/ui/tests/acceptance/jobs-list-test.js +++ b/ui/tests/acceptance/jobs-list-test.js @@ -604,7 +604,7 @@ module('Acceptance | jobs list', function (hooks) { localStorage.removeItem('nomadPageSize'); }); - test('aggregateAllocStatus reflects job status correctly', async function (assert) { + test.only('aggregateAllocStatus reflects job status correctly', async function (assert) { const defaultJobParams = { createAllocations: true, shallow: true, @@ -707,6 +707,14 @@ module('Acceptance | jobs list', function (hooks) { status: 'dead', }); + server.create('job', { + ...defaultJobParams, + id: 'ancient-system-job', + status: 'dead', + type: 'system', + groupAllocCount: 0, + }); + await JobsList.visit(); assert @@ -742,6 +750,9 @@ module('Acceptance | jobs list', function (hooks) { assert .dom('[data-test-job-row="scaled-down-job"] [data-test-job-status]') .hasText('Scaled Down', 'Scaled down job is scaled down'); + assert + .dom('[data-test-job-row="ancient-system-job"] [data-test-job-status]') + .hasText('Failed', 'System job with no allocs is failed'); await percySnapshot(assert); });