mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
Merge pull request #130891 from pohly/dra-scheduler-plugin-unit-test-fix
DRA scheduler: fix potential panic during unit test verification
This commit is contained in:
@@ -1047,7 +1047,9 @@ type testContext struct {
|
||||
|
||||
func (tc *testContext) verify(t *testing.T, expected result, initialObjects []metav1.Object, result interface{}, status *framework.Status) {
|
||||
t.Helper()
|
||||
if actualErr := status.AsError(); actualErr != nil {
|
||||
if expected.status == nil {
|
||||
assert.Nil(t, status)
|
||||
} else if actualErr := status.AsError(); actualErr != nil {
|
||||
// Compare only the error strings.
|
||||
assert.ErrorContains(t, actualErr, expected.status.AsError().Error())
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user