From df09737cb3a7e91bf554d4fa712a676b8de69504 Mon Sep 17 00:00:00 2001 From: mansoora Date: Mon, 13 Jan 2025 14:34:44 +0530 Subject: [PATCH] test: fix TestConfigFileDeprecatedOptions Use minimal config struct for YAML marshaling. Replace custom mapToSortedSlice with standard library functions. Fix flag verification for deprecated experimental options. Fixes #19066 Signed-off-by: mansoora --- server/etcdmain/config_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/etcdmain/config_test.go b/server/etcdmain/config_test.go index dd46f2949310..2008ca76b7d4 100644 --- a/server/etcdmain/config_test.go +++ b/server/etcdmain/config_test.go @@ -733,9 +733,11 @@ func TestConfigFileDeprecatedOptions(t *testing.T) { // Note: experimental-warning-unary-request-duration deprecation is handled // through a separate mechanism in embed.Config if tc.configFileYAML.ExperimentalWarningUnaryRequestDuration != 0 { - assert.Equal(t, cfg.ec.WarningUnaryRequestDuration, + assert.Equalf(t, cfg.ec.WarningUnaryRequestDuration, tc.configFileYAML.ExperimentalWarningUnaryRequestDuration, - "experimental warning duration should match") + "experimental warning duration mismatch - expected: %v, got: %v", + tc.configFileYAML.ExperimentalWarningUnaryRequestDuration, + cfg.ec.WarningUnaryRequestDuration) } }) }