command: print a warning if we get 0 evaluated nodes

This commit is contained in:
Ryan Uber
2015-09-21 16:20:50 -07:00
parent 5596f8419d
commit 7d64e1fa2d
2 changed files with 16 additions and 0 deletions

View File

@@ -326,4 +326,15 @@ func TestMonitor_DumpAllocStatus(t *testing.T) {
if !strings.Contains(out, `Dimension "cpu" exhausted on 1 nodes`) {
t.Fatalf("missing dimension exhaustion\n\n%s", out)
}
ui.OutputWriter.Reset()
// Dumping alloc status with no eligible nodes adds a warning
alloc.Metrics.NodesEvaluated = 0
dumpAllocStatus(ui, alloc)
// Check the output
out = ui.OutputWriter.String()
if !strings.Contains(out, "No nodes were eligible") {
t.Fatalf("missing eligibility warning\n\n%s", out)
}
}