diff options
author | Leif Åstrand <leif@vaadin.com> | 2011-10-17 13:04:06 +0000 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2011-10-17 13:04:06 +0000 |
commit | 1c38a69e4f1a1c47b3aff334458a9bea3b704305 (patch) | |
tree | 91996d19e6cf932367544d45d16dfd8a10ba54dd /tests | |
parent | 7c06bfa1605de089f30b7d622bf8c9ed2e0d34ae (diff) | |
download | vaadin-framework-1c38a69e4f1a1c47b3aff334458a9bea3b704305.tar.gz vaadin-framework-1c38a69e4f1a1c47b3aff334458a9bea3b704305.zip |
Added random delay before starting the quicker servers to avoid contention in the beginning
Automatically update more base files before starting the actual tests
svn changeset:21719/svn branch:6.7
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration_base_files/base.xml (renamed from tests/deploy-base.xml) | 2 | ||||
-rw-r--r-- | tests/integration_base_files/cleanup.sh | 21 | ||||
-rw-r--r-- | tests/integration_base_files/lock_age.sh | 16 | ||||
-rw-r--r-- | tests/integration_tests.xml | 36 |
4 files changed, 72 insertions, 3 deletions
diff --git a/tests/deploy-base.xml b/tests/integration_base_files/base.xml index a44b5d0133..20fe8b2d8d 100644 --- a/tests/deploy-base.xml +++ b/tests/integration_base_files/base.xml @@ -70,7 +70,7 @@ </target> <target name="check-port"> - <fail message="Something is still listening on port ${serverPort}"> + <fail message="${server}: Something is still listening on port ${serverPort}"> <condition> <socket server="localhost" port="${serverPort}" /> </condition> diff --git a/tests/integration_base_files/cleanup.sh b/tests/integration_base_files/cleanup.sh new file mode 100644 index 0000000000..d2d5445070 --- /dev/null +++ b/tests/integration_base_files/cleanup.sh @@ -0,0 +1,21 @@ +echo checking and killing open servers + +ps x | grep -E bin/java | grep -v grep | grep -v get-lock | awk '{print $1}' > temp + +#Read and kill processes marked to temp +while read line +do + kill -9 $line +done < temp + +#Remove temp +rm temp + +if [ -a /home/integration/demo.war ] + then + echo removing old demo.war + rm /home/integration/demo.war +fi + +echo Cleaning deploy dir +rm -rf /home/integration/deploy/* diff --git a/tests/integration_base_files/lock_age.sh b/tests/integration_base_files/lock_age.sh new file mode 100644 index 0000000000..1808ec05df --- /dev/null +++ b/tests/integration_base_files/lock_age.sh @@ -0,0 +1,16 @@ +#! /bin/bash +if [ -a /home/integration/deploy/lock.file ] + then + DATE=$(date +%s) + LOCK_AGE=$(stat -c %Z /home/integration/deploy/lock.file) + + AGE=$[($DATE - $LOCK_AGE)/60] + + if [ "$AGE" -gt "15" ] + then + echo lock.file is $AGE min old. + ./cleanup.sh +# else +# echo lock.file is $AGE min old. + fi +fi diff --git a/tests/integration_tests.xml b/tests/integration_tests.xml index 9217190499..9027686e7f 100644 --- a/tests/integration_tests.xml +++ b/tests/integration_tests.xml @@ -96,72 +96,84 @@ <target name="integration-test-tomcat7">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="tomcat7" />
</antcall>
</target>
<target name="integration-test-tomcat4">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="tomcat4" />
</antcall>
</target>
<target name="integration-test-tomcat5">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="tomcat5" />
</antcall>
</target>
<target name="integration-test-tomcat6">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="tomcat6" />
</antcall>
</target>
<target name="integration-test-jetty5">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="jetty5" />
</antcall>
</target>
<target name="integration-test-jetty6">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="jetty6" />
</antcall>
</target>
<target name="integration-test-jetty7">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="jetty7" />
</antcall>
</target>
<target name="integration-test-jboss3">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="jboss3" />
</antcall>
</target>
<target name="integration-test-jboss4">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="jboss4" />
</antcall>
</target>
<target name="integration-test-jboss5">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="jboss5" />
</antcall>
</target>
<target name="integration-test-glassfish2">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="glassfish2" />
</antcall>
</target>
<target name="integration-test-glassfish3">
<antcall target="run-generic-integration-test">
+ <param name="startDelay" value="300" />
<param name="target-server" value="glassfish3" />
</antcall>
</target>
@@ -302,8 +314,28 @@ <property name="target-host" value="${target-server}.devnet.vaadin.com" />
<property name="target-port" value="8080" />
- <scp file="deploy-base.xml" todir="${user}@${target-host}:base.xml" keyfile="${sshkey.file}" trust="yes" passphrase="${passphrase}" />
- <sshexec host="${target-host}" username="${user}" keyfile="${sshkey.file}" trust="yes" command="ant -f deploy.xml get-lock" />
+ <if>
+ <isset property="startDelay" />
+ <then>
+ <math result="sleepTime" datatype="int">
+ <op op="rint">
+ <op op="*">
+ <num value="${startDelay}"/>
+ <op op="random"/>
+ </op>
+ </op>
+ </math>
+ <echo>Delaying startup of ${target-server} with ${sleepTime} seconds</echo>
+ <sleep seconds="${sleepTime}" />
+ </then>
+ </if>
+
+ <scp todir="${user}@${target-host}:." keyfile="${sshkey.file}" trust="yes" passphrase="${passphrase}" >
+ <fileset dir="integration_base_files">
+ <include name="*" />
+ </fileset>
+ </scp>
+ <sshexec host="${target-host}" username="${user}" keyfile="${sshkey.file}" trust="yes" command="chmod +x *.sh; ant -f deploy.xml get-lock" />
<scp file="${demo.war}" todir="${user}@${target-host}:demo.war" keyfile="${sshkey.file}" trust="yes" passphrase="${passphrase}" />
<sshexec host="${target-host}" username="${user}" keyfile="${sshkey.file}" trust="yes" command="ant -f deploy.xml startup-and-deploy" />
|