Skip to content

Commit dfe3011

Browse files
dependabot[bot]robobario
authored andcommitted
Remove infinite loop
Signed-off-by: Robert Young <[email protected]>
1 parent 4f2aba6 commit dfe3011

File tree

1 file changed

+3
-14
lines changed
  • kroxylicious-integration-tests/src/test/java/io/kroxylicious/proxy/filter/authorization

1 file changed

+3
-14
lines changed

kroxylicious-integration-tests/src/test/java/io/kroxylicious/proxy/filter/authorization/KafkaDriver.java

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,28 +116,17 @@ private static SyncGroupRequestData syncGroupRequestData(short syncGroupVersion,
116116
return result;
117117
}
118118

119-
@SuppressWarnings({ "BusyWait", "java:S2925" })
120-
FindCoordinatorResponseData findCoordinator(CoordinatorType coordinatorType, String key) {
121-
do {
119+
void findCoordinator(CoordinatorType coordinatorType, String key) {
120+
Awaitility.await().untilAsserted(() -> {
122121
short findCoordinatorVersion = (short) 1;
123122
FindCoordinatorRequestData request = findCoordinatorRequestData(findCoordinatorVersion, coordinatorType, key);
124123
FindCoordinatorResponseData response = sendRequest(request, findCoordinatorVersion,
125124
FindCoordinatorResponseData.class);
126125
Errors actual = Errors.forCode(response.errorCode());
127-
if (actual == Errors.COORDINATOR_NOT_AVAILABLE) {
128-
try {
129-
Thread.sleep(10);
130-
}
131-
catch (InterruptedException e) {
132-
throw new RuntimeException(e);
133-
}
134-
continue;
135-
}
136126
assertThat(actual)
137127
.as("FindCoordinator response from %s (errorMessage=%s)", cluster, response.errorMessage())
138128
.isEqualTo(Errors.NONE);
139-
return response;
140-
} while (true);
129+
});
141130
}
142131

143132
JoinGroupResponseData joinGroup(String protocolType, String groupId, String groupInstanceId) {

0 commit comments

Comments
 (0)