You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2022/07/09 11:18:15 UTC

[jmeter] branch master updated: Check if target is reachable, before generating args for test

This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 07b67a0ec9 Check if target is reachable, before generating args for test
07b67a0ec9 is described below

commit 07b67a0ec917c73a3ddf6ab29167bb55e3583282
Author: Felix Schumacher <fe...@internetallee.de>
AuthorDate: Sat Jul 9 13:17:40 2022 +0200

    Check if target is reachable, before generating args for test
    
    Travis doesn't add [::1] to it's local IPv6 interface on newer Ubuntu distros.
---
 .../protocol/http/sampler/ParallelResourcesAndIpSource.java       | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/sampler/ParallelResourcesAndIpSource.java b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/sampler/ParallelResourcesAndIpSource.java
index 5034943860..9b50751b0b 100644
--- a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/sampler/ParallelResourcesAndIpSource.java
+++ b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/sampler/ParallelResourcesAndIpSource.java
@@ -19,6 +19,7 @@ package org.apache.jmeter.protocol.http.sampler;
 
 import static org.junit.jupiter.params.provider.Arguments.arguments;
 
+import java.io.IOException;
 import java.net.Inet4Address;
 import java.net.Inet6Address;
 import java.net.InetAddress;
@@ -114,6 +115,13 @@ public class ParallelResourcesAndIpSource {
                     // with the given source IP
                     continue;
                 }
+                try {
+                    if (!InetAddress.getByName(targetHost).isReachable(100)) {
+                        continue;
+                    }
+                } catch (IOException e) {
+                    continue;
+                }
 
                 localIps.forEach(localIp -> {
                     if (finalLocal4 != null) {