Skip to content

Commit

Permalink
[TEST] Replace reference to blacklist with failed (elastic#75866)
Browse files Browse the repository at this point in the history
This commit replaces use of "blacklist" with "failed" to better
reflect the behaviour of the test

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
2 people authored and elasticsearchmachine committed Jul 30, 2021
1 parent ed2eb8e commit 5efd374
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ private PortBlockingRunnable(InetAddress serverAddress, int serverPort, int port
@Override
public void run() {
final List<Socket> openedSockets = new ArrayList<>();
final List<InetAddress> blacklistedAddress = new ArrayList<>();
final List<InetAddress> failedAddresses = new ArrayList<>();
try {
final boolean allSocketsOpened = waitUntil(() -> {
try {
Expand All @@ -336,16 +336,16 @@ public void run() {
}
final List<InetAddress> inetAddressesToBind = Arrays.stream(allAddresses)
.filter(addr -> openedSockets.stream().noneMatch(s -> addr.equals(s.getLocalAddress())))
.filter(addr -> blacklistedAddress.contains(addr) == false)
.filter(addr -> failedAddresses.contains(addr) == false)
.collect(Collectors.toList());
for (InetAddress localAddress : inetAddressesToBind) {
try {
final Socket socket = openMockSocket(serverAddress, serverPort, localAddress, portToBind);
openedSockets.add(socket);
logger.debug("opened socket [{}]", socket);
} catch (NoRouteToHostException | ConnectException e) {
logger.debug(new ParameterizedMessage("blacklisting address [{}] due to:", localAddress), e);
blacklistedAddress.add(localAddress);
logger.debug(new ParameterizedMessage("marking address [{}] as failed due to:", localAddress), e);
failedAddresses.add(localAddress);
}
}
if (openedSockets.size() == 0) {
Expand Down

0 comments on commit 5efd374

Please sign in to comment.