mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-17 11:28:58 +00:00
test: topologymanager: handle panic in test
unexpected success should cause a test failure, not a panic Signed-off-by: Francesco Romani <fromani@redhat.com>
This commit is contained in:
@@ -154,7 +154,9 @@ func TestNewTopologyManagerOptions(t *testing.T) {
|
||||
}
|
||||
opts, err := NewPolicyOptions(logger, tcase.policyOptions)
|
||||
if tcase.expectedErr != nil {
|
||||
if !strings.Contains(err.Error(), tcase.expectedErr.Error()) {
|
||||
if err == nil {
|
||||
t.Errorf("expected error %v, got no error", tcase.expectedErr)
|
||||
} else if !strings.Contains(err.Error(), tcase.expectedErr.Error()) {
|
||||
t.Errorf("Unexpected error message. Have: %s, wants %s", err.Error(), tcase.expectedErr.Error())
|
||||
}
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user