Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit bec9a10

Browse files
committed
J-477: "Clean-up performance jobs (WLS, Grizzly)"
Just part of J-477, or just little follow up of J-459: - coping WLS server logs to hudson slave, available as build artifacts in hudson - clean/kill java process on server side at the beginning of job. after each single test and finally as trap cleanup - path to MEASUREMENT_DATA is configurable Change-Id: I2e10a6f9f26bd8a0fd11762612788943af366d31
1 parent ea73ae4 commit bec9a10

File tree

5 files changed

+49
-20
lines changed

5 files changed

+49
-20
lines changed

tests/performance/etc/data/MEASUREMENT_DATA

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ interceptor-dynamic|wrk -c64 -t16 -d800s -s text-put.lua http://SERVER_MACHINE:S
3838
interceptor-dynamic|wrk -c64 -t16 -d800s http://SERVER_MACHINE:SERVER_PORT/APP_CONTEXT/|org.glassfish.jersey.tests.performance.interceptor.dynamic.JaxRsApplication||metrics:name=org.glassfish.jersey.server.ApplicationHandler.handle|interceptor-dynamic-get.properties
3939
proxy-injection|wrk -c64 -t16 -d800s http://SERVER_MACHINE:SERVER_PORT/APP_CONTEXT/method-injected/without-parameters|org.glassfish.jersey.tests.performance.proxy.injection.JaxRsApplication||metrics:name=org.glassfish.jersey.server.ApplicationHandler.handle|proxy-injection-raw-gets.properties
4040
proxy-injection|wrk -c64 -t16 -d800s http://SERVER_MACHINE:SERVER_PORT/APP_CONTEXT/method-injected/all-parameters|org.glassfish.jersey.tests.performance.proxy.injection.JaxRsApplication||metrics:name=org.glassfish.jersey.server.ApplicationHandler.handle|proxy-injection-method-params.properties
41-
proxy-injection|wrk -c64 -t16 -d800s http://SERVER_MACHINE:SERVER_PORT/APP_CONTEXT/field-injected/without-parameters|org.glassfish.jersey.tests.performance.proxy.injection.JaxRsApplication||metrics:name=org.glassfish.jersey.server.ApplicationHandler.handle|proxy-injection-field-params.properties
41+
proxy-injection|wrk -c64 -t16 -d800s http://SERVER_MACHINE:SERVER_PORT/APP_CONTEXT/field-injected/without-parameters|org.glassfish.jersey.tests.performance.proxy.injection.JaxRsApplication||metrics:name=org.glassfish.jersey.server.ApplicationHandler.handle|proxy-injection-field-params.properties

tests/performance/etc/hudson/jersey2-performance-test-common.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,10 @@ WAIT_FOR_APP_STARTUP_SEC=20
5252
WAIT_FOR_APP_RUNNING_SEC=60
5353
CHECK_RUNNER_INTERVAL=5
5454
CHECK_TERM_INTERVAL=10
55+
5556
JMX_URI_TEMPLATE="service:jmx:rmi:///jndi/rmi://SERVER_MACHINE:11112/jmxrmi"
5657
SAMPLES=30
5758

58-
#WARM_UP_SECONDS=10
59-
#WAIT_FOR_APP_STARTUP_SEC=15
60-
#WAIT_FOR_APP_RUNNING_SEC=5
61-
#SAMPLES=3
62-
6359
MODULES_TO_BUILD=""
6460
for app in ${APP_LIST[*]}; do
6561
MODULES_TO_BUILD="$MODULES_TO_BUILD,tests/performance/test-cases/$app"
@@ -190,9 +186,9 @@ function testLoop {
190186
# MEASUREMENT_DATA is a boundary for the input data in the following format:
191187
# application directory name|command line to generate load on client machines|JMX URI for the application|MBean name|output filename
192188

193-
echo "########### Let's test it, reading from ~/MEASUREMENT_DATA file"
189+
echo "########### Let's test it, reading from $MEASUREMENT_DATA file"
194190

195-
cat ~/MEASUREMENT_DATA | while IFS="\|" read app ab_cmdline app_class agent_param mbean filename
191+
cat $MEASUREMENT_DATA | while IFS="\|" read app ab_cmdline app_class agent_param mbean filename
196192
do
197193
echo "========================================= DATA =============================================="
198194
echo "app = $app"
@@ -244,12 +240,18 @@ function buildTestAppOnServers {
244240
}
245241

246242
function cleanupServer {
247-
echo "########### Kill all server processes"
243+
echo "########### Kill java processes on server $1"
244+
ssh -n jerseyrobot@$1 'if ! test -e `ps h o pid -Cjava`; then kill -s INT `ps h o pid -Cjava` ; fi'
245+
}
246+
247+
function cleanupServers {
248+
echo "########### Kill all java processes on each server"
248249
for SERVER_MACHINE in ${SERVER_LIST[@]}; do
249-
ssh -n jerseyrobot@${SERVER_MACHINE} 'kill -15 -1'
250+
cleanupServer ${SERVER_MACHINE}
250251
done
251252
}
252253

253254

254-
trap "rm -f $STATUS_DIR/.runner.* $STATUS_DIR/.group.*; cleanupServer" EXIT SIGTERM SIGINT
255+
trap "rm -f $STATUS_DIR/.runner.* $STATUS_DIR/.group.*; cleanupServers" EXIT SIGTERM SIGINT
256+
#uncomment for debug purposes
255257
#trap 'echo "[$BASH_SOURCE:$LINENO] $BASH_COMMAND" >> .debug; tail -10 .debug > .debug.swap; mv .debug.swap .debug' DEBUG

tests/performance/etc/hudson/jersey2-performance-test-grizzly.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
# createMachineFiles 1 1 server1 client1a client1b
5151
# createMachineFiles 1 2 server2 client2a client2b
5252
# SERVER_LIST=(server1 server2)
53+
# MEASUREMENT_DATA=~/MEASUREMENT_DATA
5354
#
5455

5556
SERVER_PORT=8080
@@ -106,6 +107,8 @@ function singleTest() {
106107
echo -n "########### terminating Jersey app..."
107108
ssh jerseyrobot@$SERVER_MACHINE '(cd workspace/jersey/tests/performance/runners/jersey2-grizzly-runner && ./stop.sh)'
108109

110+
cleanupServer $SERVER_MACHINE
111+
109112
releaseRunnerAndGroup $actual_runner $group_id
110113
}
111114

@@ -124,16 +127,19 @@ for app in ${APP_LIST[*]}; do
124127
for SERVER_MACHINE in ${SERVER_LIST[@]}; do
125128
ssh -n jerseyrobot@${SERVER_MACHINE} 'cd workspace/jersey/tests/performance/test-cases/'$app'; mkdir -p lib;rm -f lib/*.jar && (cd lib; unzip ../target/*.zip)' &
126129
done
127-
wait
128130
done
129131

132+
wait
133+
130134
echo "########### Build and package (lib dir) test runner"
131135
for SERVER_MACHINE in ${SERVER_LIST[@]}; do
132136
ssh -n jerseyrobot@${SERVER_MACHINE} 'cd workspace/jersey; mvn -pl tests/performance/runners/jersey2-grizzly-runner clean install; cd tests/performance/runners/jersey2-grizzly-runner;mkdir -p lib;rm -f lib/*.jar && (cd lib; unzip ../target/*.zip)' &
133137
done
134138

135139
wait
136140

141+
cleanupServers
142+
137143
testLoop
138144

139145
waitForTerminator

tests/performance/etc/hudson/jersey2-performance-test-wls.sh

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,16 @@
5151
# createMachineFiles 1 1 server1 client1a client1b
5252
# createMachineFiles 1 2 server2 client2a client2b
5353
# SERVER_LIST=(server1 server2)
54+
# MEASUREMENT_DATA=~/MEASUREMENT_DATA
5455
#
5556

57+
LOGS_DIR=$WORKSPACE/logs
58+
5659
SERVER_PORT=7001
5760

61+
# override defaults from jersey2-performance-test-common.sh
62+
WAIT_FOR_APP_STARTUP_SEC=40
63+
5864
function singleTest() {
5965
echo "================================================================================="
6066
echo "===== SINGLE TEST RUN, SERVER=$SERVER_MACHINE, loader=$ab_cmdline, app=$app, JMX_URI=$JMX_URI ====="
@@ -72,7 +78,7 @@ function singleTest() {
7278
done
7379

7480
echo "########### going to (auto)deploy the test app $app"
75-
ssh -n jerseyrobot@${SERVER_MACHINE} '(cp workspace/jersey/tests/performance/test-cases/'$app'/'$app'.war workspace/jersey/tests/performance/runners/jersey2-wls-runner/target/autodeploy)' &
81+
ssh -n jerseyrobot@${SERVER_MACHINE} '(cp workspace/jersey/tests/performance/test-cases/'$app'/'$app'.war workspace/jersey/tests/performance/runners/jersey2-wls-runner/target/autodeploy; ls -la workspace/jersey/tests/performance/runners/jersey2-wls-runner/target/autodeploy)' &
7682

7783
waitForGroupStatus $actual_runner $group_id "open"
7884

@@ -95,7 +101,7 @@ function singleTest() {
95101

96102
for client_machine in ${CLIENT_LIST[*]}; do
97103
echo "########### going to start load generator at $client_machine again"
98-
(sleep $WAIT_FOR_APP_STARTUP_SEC; ssh -n jerseyrobot@$client_machine "nohup $ab_cmdline" & ) &
104+
(ssh -n jerseyrobot@$client_machine "nohup $ab_cmdline" & ) &
99105
done
100106

101107
echo "########### waiting before start capturing jmx data"
@@ -114,10 +120,12 @@ function singleTest() {
114120
done
115121

116122
echo "########### Stop WLS server"
117-
ssh -n jerseyrobot@${SERVER_MACHINE} 'cd workspace/jersey/tests/performance/runners/jersey2-wls-runner; ./stop.sh' &
123+
ssh -n jerseyrobot@${SERVER_MACHINE} '(cd workspace/jersey/tests/performance/runners/jersey2-wls-runner; ./stop.sh)' &
124+
just_filename=`echo ${filename} | sed -e 's/\.[^.]*$//'`
125+
scp jerseyrobot@${SERVER_MACHINE}:workspace/jersey/tests/performance/runners/jersey2-wls-runner/target/server.log $LOGS_DIR/${just_filename}-server.log
126+
scp jerseyrobot@${SERVER_MACHINE}:workspace/jersey/tests/performance/runners/jersey2-wls-runner/target/domain.log $LOGS_DIR/${just_filename}-domain.log
118127

119-
echo "########### let's WLS on $SERVER_MACHINE get some 'recovery' time"
120-
sleep 5
128+
cleanupServer $SERVER_MACHINE
121129

122130
releaseRunnerAndGroup $actual_runner $group_id
123131
}
@@ -126,6 +134,9 @@ function singleTest() {
126134
# test process start
127135
#
128136

137+
mkdir -p $LOGS_DIR
138+
rm -f $LOGS_DIR/*
139+
129140
removeOldCapturedData
130141

131142
retrieveJmxClient
@@ -137,16 +148,19 @@ for app in ${APP_LIST[*]}; do
137148
for SERVER_MACHINE in ${SERVER_LIST[@]}; do
138149
ssh -n jerseyrobot@${SERVER_MACHINE} '(cd workspace/jersey/tests/performance/test-cases/'$app'; cp target/*.war '$app'.war)' &
139150
done
140-
wait
141151
done
142152

153+
wait
154+
143155
echo "########### Install WLS server"
144156
for SERVER_MACHINE in ${SERVER_LIST[@]}; do
145157
ssh -n jerseyrobot@${SERVER_MACHINE} '(cd workspace/jersey/tests/performance/runners/jersey2-wls-runner; ./install.sh '$WEBLOGIC_OUI_URL')' &
146158
done
147159

148160
wait
149161

162+
cleanupServers
163+
150164
testLoop
151165

152166
waitForTerminator

tests/performance/runners/jersey2-wls-runner/start.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
TARGET=$PWD/target
4242
MW_HOME=`cat $TARGET/mw_home.txt`
4343
TEST_DOMAIN=$MW_HOME/hudson_test_domain
44+
DOMAIN_NAME=HudsonTestDomain
45+
SERVER_NAME=HudsonTestServer
4446
PID_FILE=$TARGET/wls.pid
4547

4648
echo $TEST_DOMAIN > $TARGET/test_domain.txt
@@ -55,14 +57,19 @@ cd $TEST_DOMAIN
5557
rm -f $TARGET/autodeploy
5658
ln -s $TEST_DOMAIN/autodeploy $TARGET/autodeploy
5759

60+
rm -f $TARGET/server.log
61+
rm -f $TARGET/domain.log
62+
ln -s $TEST_DOMAIN/servers/$SERVER_NAME/logs/$SERVER_NAME.log $TARGET/server.log
63+
ln -s $TEST_DOMAIN/servers/$SERVER_NAME/logs/$DOMAIN_NAME.log $TARGET/domain.log
64+
5865
JAVA_OPTIONS="-javaagent:$HOME/jersey-perftest-agent.jar"
5966

6067
yes | nohup java -server \
6168
-Xms1024m \
6269
-Xmx1024m \
6370
-XX:MaxPermSize=256m \
64-
-Dweblogic.Domain=HudsonTestDomain \
65-
-Dweblogic.Name=HudsonTestServer \
71+
-Dweblogic.Domain=$DOMAIN_NAME \
72+
-Dweblogic.Name=$SERVER_NAME \
6673
-Dweblogic.management.username=weblogic \
6774
-Dweblogic.management.password=weblogic1 \
6875
-Dweblogic.ListenPort=7001 \

0 commit comments

Comments
 (0)