chia7712 commented on code in PR #17046:
URL: https://github.com/apache/kafka/pull/17046#discussion_r1752703160
##########
core/src/test/java/kafka/admin/ConfigCommandIntegrationTest.java:
##########
@@ -589,6 +658,16 @@ private void verifyGroupConfig(Admin client, String
groupName, Map<String, Strin
}, 10000, config + " are not updated");
}
+ private void verifyClientMetricsConfig(Admin client, String
clientMetricsName, Map<String, String> config) throws Exception {
+ ConfigResource configResource = new
ConfigResource(ConfigResource.Type.CLIENT_METRICS, clientMetricsName);
+ TestUtils.waitForCondition(() -> {
+ Map<String, String> current = getConfigEntryStream(client,
configResource)
+ .filter(configEntry ->
Objects.nonNull(configEntry.value()))
+ .collect(Collectors.toMap(ConfigEntry::name,
ConfigEntry::value));
+ return config.entrySet().stream().allMatch(e ->
e.getValue().equals(current.get(e.getKey())));
Review Comment:
Sorry for unclear comments.
My point was the test case which want to "delete all configs" should check
`current.isEmpty()` instead. For example:
```java
private void verifyClientMetricsConfig(Admin client, String
clientMetricsName, Map<String, String> config) throws Exception {
ConfigResource configResource = new
ConfigResource(ConfigResource.Type.CLIENT_METRICS, clientMetricsName);
TestUtils.waitForCondition(() -> {
Map<String, String> current = getConfigEntryStream(client,
configResource)
.filter(configEntry ->
Objects.nonNull(configEntry.value()))
.collect(Collectors.toMap(ConfigEntry::name,
ConfigEntry::value));
// make sure there are no configs anymore
if (config.isEmpty()) return current.isEmpty();
return config.entrySet().stream().allMatch(e ->
e.getValue().equals(current.get(e.getKey())));
}, 10000, config + " are not updated");
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]