From f88c4d76485eaf249da5530b89cc947c92dffcf2 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Thu, 9 May 2019 10:26:55 -0700 Subject: [PATCH] Fixed flaky client-detail test Since one allocation is preempted, the alloc factory creates a new alloc that wasn't guaranteed to be running. When it is the first alloc row in the table, then the alloc row detail test fails because non-running allocs don't have metrics. The fix was to manually update all the alloc clientStatuses. --- ui/tests/acceptance/client-detail-test.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/tests/acceptance/client-detail-test.js b/ui/tests/acceptance/client-detail-test.js index 2307731ed..df44f873d 100644 --- a/ui/tests/acceptance/client-detail-test.js +++ b/ui/tests/acceptance/client-detail-test.js @@ -25,8 +25,14 @@ module('Acceptance | client detail', function(hooks) { // Related models server.create('agent'); server.create('job', { createAllocations: false }); - server.createList('allocation', 3, { nodeId: node.id, clientStatus: 'running' }); - server.create('allocation', 'preempted', { nodeId: node.id, clientStatus: 'running' }); + server.createList('allocation', 3); + server.create('allocation', 'preempted'); + + // Force all allocations into the running state so now allocation rows are missing + // CPU/Mem runtime metrics + server.schema.allocations.all().models.forEach(allocation => { + allocation.update({ clientStatus: 'running' }); + }); }); test('/clients/:id should have a breadcrumb trail linking back to clients', async function(assert) {