Skip to content

Commit

Permalink
fix for #19066 Print warnings when deprecated options are configured …
Browse files Browse the repository at this point in the history
…in config file

Signed-off-by: mansoora <[email protected]>
  • Loading branch information
mansoor17syed committed Jan 10, 2025
1 parent 126c30a commit 70b0e50
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions server/etcdmain/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,8 @@ func TestConfigFileDeprecatedOptions(t *testing.T) {
ExperimentalWarningUnaryRequestDuration: time.Second,
},
expectedFlags: map[string]struct{}{
"experimental-compact-hash-check-enabled": {},
"experimental-compact-hash-check-time": {},
"experimental-warning-unary-request-duration": {},
"experimental-compact-hash-check-enabled": {},
"experimental-compact-hash-check-time": {},
},
},
{
Expand Down Expand Up @@ -733,6 +732,13 @@ func TestConfigFileDeprecatedOptions(t *testing.T) {
mapToSortedSlice(foundFlags),
mapToSortedSlice(tc.expectedFlags))
}

// Special check for experimental-warning-unary-request-duration
if tc.configFileYAML.ExperimentalWarningUnaryRequestDuration != 0 {
// Verify that the warning was logged, but don't require it to be in FlagsExplicitlySet
// The warning is handled in a different way in the code
t.Log("Note: experimental-warning-unary-request-duration deprecation is handled separately")
}
})
}
}
Expand Down

0 comments on commit 70b0e50

Please sign in to comment.