You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by il...@apache.org on 2019/07/09 14:48:02 UTC

[dubbo-samples] branch master updated: make sure all samples processes end completely after integration test finishes

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

iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git


The following commit(s) were added to refs/heads/master by this push:
     new 8947c62  make sure all samples processes end completely after integration test finishes
8947c62 is described below

commit 8947c62dfb9142eb827c73ba817dc7063861f4ba
Author: Ian Luo <ia...@gmail.com>
AuthorDate: Tue Jul 9 22:45:52 2019 +0800

    make sure all samples processes end completely after integration test finishes
---
 .../dubbo-samples-thrift-impl/pom.xml              | 23 ++++++++++++++++++++++
 dubbo-samples-transaction/pom.xml                  | 22 +++++++++++++++++++++
 dubbo-samples-version/pom.xml                      | 23 ++++++++++++++++++++++
 dubbo-samples-zipkin/pom.xml                       | 23 ++++++++++++++++++++++
 .../java/org/apache/dubbo/samples/TraceIT.java     |  2 +-
 killall.sh                                         |  4 ++++
 6 files changed, 96 insertions(+), 1 deletion(-)

diff --git a/dubbo-samples-thrift/dubbo-samples-thrift-impl/pom.xml b/dubbo-samples-thrift/dubbo-samples-thrift-impl/pom.xml
index 3a352d2..7ce2609 100644
--- a/dubbo-samples-thrift/dubbo-samples-thrift-impl/pom.xml
+++ b/dubbo-samples-thrift/dubbo-samples-thrift-impl/pom.xml
@@ -168,6 +168,29 @@
 
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <version>1.8</version>
+                        <executions>
+                            <execution>
+                                <id>kill-process</id>
+                                <phase>post-integration-test</phase>
+                                <configuration>
+                                    <target name="ending">
+                                        <echo>kill dubbo applications</echo>
+                                        <exec executable="bash" spawn="true" dir="${project.basedir}/../..">
+                                            <arg value="killall.sh"/>
+                                        </exec>
+                                    </target>
+                                </configuration>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-failsafe-plugin</artifactId>
                         <version>${maven-failsafe-plugin.version}</version>
                         <executions>
diff --git a/dubbo-samples-transaction/pom.xml b/dubbo-samples-transaction/pom.xml
index 7011594..7489cb5 100644
--- a/dubbo-samples-transaction/pom.xml
+++ b/dubbo-samples-transaction/pom.xml
@@ -289,7 +289,29 @@
                                     </arguments>
                                 </configuration>
                             </execution>
+                        </executions>
+                    </plugin>
 
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <version>1.8</version>
+                        <executions>
+                            <execution>
+                                <id>kill-process</id>
+                                <phase>post-integration-test</phase>
+                                <configuration>
+                                    <target name="ending">
+                                        <echo>kill dubbo applications</echo>
+                                        <exec executable="bash" spawn="true" dir="${project.basedir}/..">
+                                            <arg value="killall.sh"/>
+                                        </exec>
+                                    </target>
+                                </configuration>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
                         </executions>
                     </plugin>
 
diff --git a/dubbo-samples-version/pom.xml b/dubbo-samples-version/pom.xml
index 3cf2594..a16bdb5 100644
--- a/dubbo-samples-version/pom.xml
+++ b/dubbo-samples-version/pom.xml
@@ -192,6 +192,29 @@
 
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <version>1.8</version>
+                        <executions>
+                            <execution>
+                                <id>kill-process</id>
+                                <phase>post-integration-test</phase>
+                                <configuration>
+                                    <target name="ending">
+                                        <echo>kill dubbo applications</echo>
+                                        <exec executable="bash" spawn="true" dir="${project.basedir}/..">
+                                            <arg value="killall.sh"/>
+                                        </exec>
+                                    </target>
+                                </configuration>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-failsafe-plugin</artifactId>
                         <version>${maven-failsafe-plugin.version}</version>
                         <executions>
diff --git a/dubbo-samples-zipkin/pom.xml b/dubbo-samples-zipkin/pom.xml
index 565af0e..466f604 100644
--- a/dubbo-samples-zipkin/pom.xml
+++ b/dubbo-samples-zipkin/pom.xml
@@ -253,6 +253,29 @@
 
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <version>1.8</version>
+                        <executions>
+                            <execution>
+                                <id>kill-process</id>
+                                <phase>post-integration-test</phase>
+                                <configuration>
+                                    <target name="ending">
+                                        <echo>kill dubbo applications</echo>
+                                        <exec executable="bash" spawn="true" dir="${project.basedir}/..">
+                                            <arg value="killall.sh"/>
+                                        </exec>
+                                    </target>
+                                </configuration>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-failsafe-plugin</artifactId>
                         <version>${maven-failsafe-plugin.version}</version>
                         <executions>
diff --git a/dubbo-samples-zipkin/src/test/java/org/apache/dubbo/samples/TraceIT.java b/dubbo-samples-zipkin/src/test/java/org/apache/dubbo/samples/TraceIT.java
index 7d277e7..c23bd59 100644
--- a/dubbo-samples-zipkin/src/test/java/org/apache/dubbo/samples/TraceIT.java
+++ b/dubbo-samples-zipkin/src/test/java/org/apache/dubbo/samples/TraceIT.java
@@ -46,7 +46,7 @@ public class TraceIT {
     public void testTrace() throws Exception {
         Assert.assertEquals("greeting, hello, world", greetingService.greeting("world"));
 
-        Thread.sleep(1000);
+        Thread.sleep(2000);
 
         OkHttpClient client = new OkHttpClient();
 
diff --git a/killall.sh b/killall.sh
new file mode 100755
index 0000000..75ca71d
--- /dev/null
+++ b/killall.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+ps ax | grep 'java' | grep 'org.apache.dubbo.samples' | awk '{ print $1 }' | xargs echo
+ps ax | grep 'java' | grep 'org.apache.dubbo.samples' | awk '{ print $1 }' | xargs kill -9


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org