Skip to content

Commit

Permalink
Add handling for empty state flaky test edge case (#9234)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
backspace authored Oct 30, 2020
1 parent 1af63e4 commit d986fa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/tests/acceptance/topology-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions ui/tests/pages/components/topo-viz/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ export default scope => ({
}),

emptyMessage: text('[data-test-empty-message]'),
isEmpty: hasClass('is-empty'),
});

0 comments on commit d986fa1

Please sign in to comment.