diff --git a/server/etcdmain/config_test.go b/server/etcdmain/config_test.go index 5545c62966a..749953e5dad 100644 --- a/server/etcdmain/config_test.go +++ b/server/etcdmain/config_test.go @@ -18,17 +18,16 @@ import ( "errors" "flag" "fmt" - "maps" "net/url" "os" "reflect" - "slices" "strings" "testing" "time" "sigs.k8s.io/yaml" + "github.com/stretchr/testify/assert" "go.etcd.io/etcd/pkg/v3/featuregate" "go.etcd.io/etcd/pkg/v3/flags" "go.etcd.io/etcd/server/v3/embed" @@ -728,15 +727,12 @@ func TestConfigFileDeprecatedOptions(t *testing.T) { } // Compare sets of flags - if !reflect.DeepEqual(foundFlags, tc.expectedFlags) { - t.Errorf("deprecated flags mismatch:\ngot: %v\nwant: %v", - slices.Sorted(maps.Keys(foundFlags)), - slices.Sorted(maps.Keys(tc.expectedFlags))) - } + assert.Equal(t, tc.expectedFlags, foundFlags, "deprecated flags mismatch") - // Special check for experimental-warning-unary-request-duration + // Note: experimental-warning-unary-request-duration deprecation is handled + // through a separate mechanism in embed.Config if tc.configFileYAML.ExperimentalWarningUnaryRequestDuration != 0 { - t.Log("Note: experimental-warning-unary-request-duration deprecation is handled separately") + // Skip checking this flag as it's handled differently } }) }