Add handling for empty state flaky test edge case (#9234)

This test occasionally fails because the random generation
sometimes produces a node with no allocations, such as here:
https://app.circleci.com/pipelines/github/hashicorp/nomad/12735/workflows/9a407f87-0383-48ee-8e41-7e6e351dce28/jobs/113130/steps

This is a temporary measure to solve it without trying to force the
generated data to always have an allocation.
This commit is contained in:
Buck Doyle
2020-10-30 15:57:09 -05:00
committed by GitHub
parent 1af63e405e
commit d986fa1fdc
2 changed files with 7 additions and 2 deletions

View File

@@ -56,8 +56,12 @@ module('Acceptance | topology', function(hooks) {
await Topology.visit();
await Topology.viz.datacenters[0].nodes[0].memoryRects[0].select();
assert.equal(Topology.infoPanelTitle, 'Allocation Details');
if (Topology.viz.datacenters[0].nodes[0].isEmpty) {
assert.expect(0);
} else {
await Topology.viz.datacenters[0].nodes[0].memoryRects[0].select();
assert.equal(Topology.infoPanelTitle, 'Allocation Details');
}
});
test('when a node is selected, the info panel shows information on the node', async function(assert) {

View File

@@ -33,4 +33,5 @@ export default scope => ({
}),
emptyMessage: text('[data-test-empty-message]'),
isEmpty: hasClass('is-empty'),
});