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 <elasticmachine@users.noreply.github.com>
  • Loading branch information
tvernum and elasticmachine authored Jul 30, 2021
1 parent 0b032fa commit 98554b4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,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 @@ -331,16 +331,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 98554b4

Please sign in to comment.