You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/11/19 11:02:17 UTC
[skywalking] branch master updated: [test/plugin] Print systeminfo
on failure (#3874)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new 6d3b0e2 [test/plugin] Print systeminfo on failure (#3874)
6d3b0e2 is described below
commit 6d3b0e2aeb52561053b808d7225594a1b40492c1
Author: zhang-wei <pk...@outlook.com>
AuthorDate: Tue Nov 19 19:02:02 2019 +0800
[test/plugin] Print systeminfo on failure (#3874)
* Print systeminfo on failure
* fix project name
* docker-compose add network
* docker-compose add network
* revert interval
---
test/plugin/containers/jvm-container/docker/run.sh | 2 +-
test/plugin/containers/tomcat-container/docker/catalina.sh | 2 +-
test/plugin/run.sh | 5 +++++
.../skywalking/plugin/test/helper/ConfigurationImpl.java | 12 ++++++++----
.../plugin/test/helper/DockerComposeRunningGenerator.java | 2 ++
.../apache/skywalking/plugin/test/helper/IConfiguration.java | 2 ++
.../runner-helper/src/main/resources/docker-compose.template | 5 +++++
test/plugin/scenarios/kafka-scenario/configuration.yml | 1 -
8 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/test/plugin/containers/jvm-container/docker/run.sh b/test/plugin/containers/jvm-container/docker/run.sh
index 78a7ae0..d2d5cd9 100644
--- a/test/plugin/containers/jvm-container/docker/run.sh
+++ b/test/plugin/containers/jvm-container/docker/run.sh
@@ -64,7 +64,7 @@ healthCheck http://localhost:12800/receiveData
# start applications
export agent_opts="-javaagent:${SCENARIO_HOME}/agent/skywalking-agent.jar
-Dskywalking.collector.grpc_channel_check_interval=2
- -Dskywalking.collector.app_and_service_register_check_interval=1
+ -Dskywalking.collector.app_and_service_register_check_interval=2
-Dskywalking.collector.discovery_check_interval=2
-Dskywalking.collector.backend_service=localhost:19876
-Dskywalking.agent.service_name=${SCENARIO_NAME}
diff --git a/test/plugin/containers/tomcat-container/docker/catalina.sh b/test/plugin/containers/tomcat-container/docker/catalina.sh
index 8f0b0f3..22ca290 100644
--- a/test/plugin/containers/tomcat-container/docker/catalina.sh
+++ b/test/plugin/containers/tomcat-container/docker/catalina.sh
@@ -109,7 +109,7 @@ echo "${AGENT_FILE_PATH}/skywalking-agent.jar"
if [ -f "${AGENT_FILE_PATH}/skywalking-agent.jar" ]; then
CATALINA_OPTS="$CATALINA_OPTS -javaagent:${AGENT_FILE_PATH}/skywalking-agent.jar
-Dskywalking.collector.grpc_channel_check_interval=2
- -Dskywalking.collector.app_and_service_register_check_interval=1
+ -Dskywalking.collector.app_and_service_register_check_interval=2
-Dskywalking.collector.discovery_check_interval=2
-Dskywalking.collector.backend_service=localhost:19876
-Dskywalking.agent.service_name=${SCENARIO_NAME}
diff --git a/test/plugin/run.sh b/test/plugin/run.sh
index 38e4a53..d5268ec 100755
--- a/test/plugin/run.sh
+++ b/test/plugin/run.sh
@@ -77,12 +77,17 @@ exitWithMessage() {
exitAndClean() {
elapsed=$(( `date +%s` - $start_stamp ))
num_of_testcases="`ls -l ${task_state_house} |grep -c FINISH`"
+ [[ $1 -eq 1 ]] && printSystemInfo
printf "Scenarios: %s, Testcases: %d, parallel_run_size: %d, Elapsed: %02d:%02d:%02d \n" \
${scenario_name} "${num_of_testcases}" "${parallel_run_size}" \
$(( ${elapsed}/3600 )) $(( ${elapsed}%3600/60 )) $(( ${elapsed}%60 ))
exit $1
}
+printSystemInfo(){
+ bash ${home}/script/systeminfo.sh
+}
+
waitForAvailable() {
while [[ `ls -l ${task_state_house} |grep -c RUNNING` -ge ${parallel_run_size} ]]
do
diff --git a/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/ConfigurationImpl.java b/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/ConfigurationImpl.java
index c454313..8271aa4 100644
--- a/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/ConfigurationImpl.java
+++ b/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/ConfigurationImpl.java
@@ -16,16 +16,16 @@
*/
package org.apache.skywalking.plugin.test.helper;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-
import com.google.common.base.Strings;
import org.apache.skywalking.plugin.test.helper.exception.ConfigureFileNotFoundException;
import org.apache.skywalking.plugin.test.helper.util.StringUtils;
import org.apache.skywalking.plugin.test.helper.vo.CaseConfiguration;
import org.yaml.snakeyaml.Yaml;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+
public class ConfigurationImpl implements IConfiguration {
private CaseConfiguration configuration;
private final String scenarioHome;
@@ -113,6 +113,10 @@ public class ConfigurationImpl implements IConfiguration {
return System.getProperty("docker.image.version", "latest");
}
+ @Override
+ public String dockerNetworkName() {
+ return (scenarioName() + "-" + dockerImageVersion()).toLowerCase();
+ }
@Override
public String dockerContainerName() {
diff --git a/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/DockerComposeRunningGenerator.java b/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/DockerComposeRunningGenerator.java
index 4001849..0d32565 100644
--- a/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/DockerComposeRunningGenerator.java
+++ b/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/DockerComposeRunningGenerator.java
@@ -62,6 +62,8 @@ public class DockerComposeRunningGenerator extends AbstractRunningGenerator {
root.put("docker_image_version", configuration.dockerImageVersion());
root.put("docker_container_name", configuration.dockerContainerName());
+ root.put("network_name", configuration.dockerNetworkName());
+
ArrayList<String> links = Lists.newArrayList();
configuration.caseConfiguration().getDependencies().forEach((k, service) -> {
links.add(service.getHostname());
diff --git a/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/IConfiguration.java b/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/IConfiguration.java
index 06916e9..4068884 100644
--- a/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/IConfiguration.java
+++ b/test/plugin/runner-helper/src/main/java/org/apache/skywalking/plugin/test/helper/IConfiguration.java
@@ -44,6 +44,8 @@ public interface IConfiguration {
String dockerContainerName();
+ String dockerNetworkName();
+
String dockerImageVersion();
String scenarioHome();
diff --git a/test/plugin/runner-helper/src/main/resources/docker-compose.template b/test/plugin/runner-helper/src/main/resources/docker-compose.template
index 03dad2b..fa928d1 100644
--- a/test/plugin/runner-helper/src/main/resources/docker-compose.template
+++ b/test/plugin/runner-helper/src/main/resources/docker-compose.template
@@ -15,6 +15,11 @@
~ limitations under the License.
-->
version: '2.1'
+
+networks:
+ default:
+ name: ${network_name}
+
services:
${docker_container_name}:
image: ${docker_image_name}:${docker_image_version}
diff --git a/test/plugin/scenarios/kafka-scenario/configuration.yml b/test/plugin/scenarios/kafka-scenario/configuration.yml
index 65647dd..40ea535 100644
--- a/test/plugin/scenarios/kafka-scenario/configuration.yml
+++ b/test/plugin/scenarios/kafka-scenario/configuration.yml
@@ -36,6 +36,5 @@ dependencies:
- KAFKA_BROKER_ID=1
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092
- - KAFKA_CFG_LOG_FLUSH_INTERVAL_MS=1000
depends_on:
- zookeeper-server
\ No newline at end of file