Skip to content

Commit 4dfed14

Browse files
authored
Merge pull request kubernetes#130891 from pohly/dra-scheduler-plugin-unit-test-fix
DRA scheduler: fix potential panic during unit test verification
2 parents 9f8a849 + d95d6ba commit 4dfed14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,9 @@ type testContext struct {
10471047

10481048
func (tc *testContext) verify(t *testing.T, expected result, initialObjects []metav1.Object, result interface{}, status *framework.Status) {
10491049
t.Helper()
1050-
if actualErr := status.AsError(); actualErr != nil {
1050+
if expected.status == nil {
1051+
assert.Nil(t, status)
1052+
} else if actualErr := status.AsError(); actualErr != nil {
10511053
// Compare only the error strings.
10521054
assert.ErrorContains(t, actualErr, expected.status.AsError().Error())
10531055
} else {

0 commit comments

Comments
 (0)