Skip to content

Commit f1e2884

Browse files
committed
print out verbose info for a scheduler e2e test
1 parent e476ab6 commit f1e2884

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test/e2e/scheduling/preemption.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,20 @@ var _ = SIGDescribe("PreemptionExecutionPath", func() {
385385
priorityPairs := make([]priorityPair, 0)
386386

387387
AfterEach(func() {
388+
// print out additional info if tests failed
389+
if CurrentGinkgoTestDescription().Failed {
390+
// list existing priorities
391+
priorityList, err := cs.SchedulingV1().PriorityClasses().List(metav1.ListOptions{})
392+
if err != nil {
393+
framework.Logf("Unable to list priorities: %v", err)
394+
} else {
395+
framework.Logf("List existing priorities:")
396+
for _, p := range priorityList.Items {
397+
framework.Logf("%v/%v created at %v", p.Name, p.Value, p.CreationTimestamp)
398+
}
399+
}
400+
}
401+
388402
if node != nil {
389403
nodeCopy := node.DeepCopy()
390404
// force it to update
@@ -428,6 +442,10 @@ var _ = SIGDescribe("PreemptionExecutionPath", func() {
428442
priorityVal := int32(i)
429443
priorityPairs = append(priorityPairs, priorityPair{name: priorityName, value: priorityVal})
430444
_, err := cs.SchedulingV1().PriorityClasses().Create(&schedulerapi.PriorityClass{ObjectMeta: metav1.ObjectMeta{Name: priorityName}, Value: priorityVal})
445+
if err != nil {
446+
framework.Logf("Failed to create priority '%v/%v': %v", priorityName, priorityVal, err)
447+
framework.Logf("Reason: %v. Msg: %v", errors.ReasonForError(err), err)
448+
}
431449
Expect(err == nil || errors.IsAlreadyExists(err)).To(Equal(true))
432450
}
433451
})
@@ -557,7 +575,6 @@ var _ = SIGDescribe("PreemptionExecutionPath", func() {
557575
}
558576
}
559577
})
560-
561578
})
562579

563580
type pauseRSConfig struct {

0 commit comments

Comments
 (0)