Make resource gatherer print the data about resource usage in case of failure

This commit is contained in:
gmarek
2016-12-09 11:55:40 +01:00
parent f8dd91fb28
commit 3361576f3b
2 changed files with 9 additions and 6 deletions

View File

@@ -387,7 +387,9 @@ func (f *Framework) AfterEach() {
summaries := make([]TestDataSummary, 0)
if TestContext.GatherKubeSystemResourceUsageData != "false" && TestContext.GatherKubeSystemResourceUsageData != "none" && f.gatherer != nil {
By("Collecting resource usage data")
summaries = append(summaries, f.gatherer.stopAndSummarize([]int{90, 99, 100}, f.AddonResourceConstraints))
summary, resourceViolationError := f.gatherer.stopAndSummarize([]int{90, 99, 100}, f.AddonResourceConstraints)
defer ExpectNoError(resourceViolationError)
summaries = append(summaries, summary)
}
if TestContext.GatherLogsSizes {