Skip to content

Commit 933b385

Browse files
committed
fix tests
1 parent 3788812 commit 933b385

1 file changed

Lines changed: 49 additions & 7 deletions

File tree

.github/workflows/load-test.yml

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
distribution: 'temurin'
2323

2424
- name: Cache Maven dependencies
25-
uses: actions/cache@v3
25+
uses: actions/cache@v4
2626
with:
2727
path: ~/.m2
2828
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
@@ -68,9 +68,23 @@ jobs:
6868
6969
- name: Start Payara application
7070
run: |
71-
mvn payara-micro:start &
72-
# Wait for application to start
73-
sleep 45
71+
echo "Starting Payara Micro in background..."
72+
nohup mvn payara-micro:start > payara-output.log 2>&1 &
73+
PAYARA_PID=$!
74+
echo "Payara PID: $PAYARA_PID"
75+
echo $PAYARA_PID > payara.pid
76+
77+
# Wait for application to be ready (max 2 minutes)
78+
echo "Waiting for Payara to start..."
79+
timeout 120 bash -c '
80+
until curl -f http://localhost:8080/payara6-ibmmq/api/simple/health >/dev/null 2>&1; do
81+
echo "Waiting for application..."
82+
sleep 5
83+
done
84+
'
85+
86+
echo "Application health check passed!"
87+
curl -s http://localhost:8080/payara6-ibmmq/api/simple/health
7488
7589
- name: Check application health
7690
run: |
@@ -164,7 +178,7 @@ jobs:
164178
echo "- **Reports Generated:** $(find results -name "index.html" | wc -l)" >> test-summary.md
165179
166180
- name: Upload test results
167-
uses: actions/upload-artifact@v3
181+
uses: actions/upload-artifact@v4
168182
if: always()
169183
with:
170184
name: load-test-results
@@ -173,7 +187,7 @@ jobs:
173187
load-tests/test-summary.md
174188
175189
- name: Comment PR with results
176-
uses: actions/github-script@v6
190+
uses: actions/github-script@v7
177191
if: github.event_name == 'pull_request'
178192
with:
179193
script: |
@@ -189,12 +203,40 @@ jobs:
189203
});
190204
}
191205
206+
- name: Stop Payara application
207+
if: always()
208+
run: |
209+
echo "Stopping Payara application..."
210+
if [ -f payara.pid ]; then
211+
PAYARA_PID=$(cat payara.pid)
212+
echo "Killing Payara process $PAYARA_PID"
213+
kill $PAYARA_PID || echo "Process already stopped"
214+
rm -f payara.pid
215+
fi
216+
# Also kill any remaining Java processes
217+
pkill -f payara-micro || echo "No payara processes found"
218+
219+
- name: Upload application logs
220+
uses: actions/upload-artifact@v4
221+
if: always()
222+
with:
223+
name: application-logs
224+
path: |
225+
payara-output.log
226+
load-tests/jmeter.log
227+
192228
- name: Show container logs on failure
193229
if: failure()
194230
run: |
195231
echo "=== IBM MQ Logs ==="
196232
docker logs ibmmq-ci
197233
echo "=== PostgreSQL Logs ==="
198234
docker logs postgres-ci
235+
echo "=== Payara Application Logs ==="
236+
if [ -f payara-output.log ]; then
237+
tail -n 100 payara-output.log
238+
fi
199239
echo "=== Container Status ==="
200-
docker ps -a
240+
docker ps -a
241+
echo "=== Process Status ==="
242+
ps aux | grep -E "(payara|java)" || echo "No Java processes found"

0 commit comments

Comments
 (0)