提交 6d3b0e2a 编写于 作者: Z zhang-wei 提交者: wu-sheng

[test/plugin] Print systeminfo on failure (#3874)

* Print systeminfo on failure

* fix project name

* docker-compose add network

* docker-compose add network

* revert interval
上级 5d064ced
......@@ -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}
......
......@@ -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}
......
......@@ -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
......
......@@ -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() {
......
......@@ -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());
......
......@@ -44,6 +44,8 @@ public interface IConfiguration {
String dockerContainerName();
String dockerNetworkName();
String dockerImageVersion();
String scenarioHome();
......
......@@ -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}
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册