From 5772ea210c9968b9df0a4c82029385567fa05161 Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Fri, 19 Jun 2020 15:43:32 -0500 Subject: [PATCH] Add cycling to factory healthy flags This is meant to address the plugin test failure seen here: https://app.circleci.com/pipelines/github/hashicorp/nomad/10015/workflows/ace5d615-db03-4cfc-86b2-31e9e00473ec/jobs/77014/tests I believe the problem was that on rare occasions, the set of mock storage controllers and nodes were all unhealthy, so the facet test had no rows to iterate through. Since there are always three of each, this guarantees some healthy ones will be present. --- ui/mirage/factories/storage-controller.js | 2 +- ui/mirage/factories/storage-node.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/mirage/factories/storage-controller.js b/ui/mirage/factories/storage-controller.js index 4399e375b..6d5866482 100644 --- a/ui/mirage/factories/storage-controller.js +++ b/ui/mirage/factories/storage-controller.js @@ -7,7 +7,7 @@ export default Factory.extend({ provider: faker.helpers.randomize(STORAGE_PROVIDERS), providerVersion: '1.0.1', - healthy: faker.random.boolean, + healthy: i => [true, false][i % 2], healthDescription() { this.healthy ? 'healthy' : 'unhealthy'; }, diff --git a/ui/mirage/factories/storage-node.js b/ui/mirage/factories/storage-node.js index b52241959..a1e684987 100644 --- a/ui/mirage/factories/storage-node.js +++ b/ui/mirage/factories/storage-node.js @@ -7,7 +7,7 @@ export default Factory.extend({ provider: faker.helpers.randomize(STORAGE_PROVIDERS), providerVersion: '1.0.1', - healthy: faker.random.boolean, + healthy: i => [true, false][i % 2], healthDescription() { this.healthy ? 'healthy' : 'unhealthy'; },