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.
This commit is contained in:
Michael Lange
2019-05-09 10:26:55 -07:00
parent 8932ccd62f
commit f88c4d7648

View File

@@ -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) {