11name : Deployment Timing Tests
22
3+ # Tests for LDEV-5478 / LDEV-5960 - deploy folder timing issues
4+ # Verifies that extensions in the deploy folder are fully initialized before requests are served
5+
36on :
47 workflow_dispatch :
58 inputs :
1518 - ' custom/deployment-tests/**'
1619 - ' .github/workflows/deployment-tests.yml'
1720
21+ env :
22+ EXPRESS_TEMPLATE_URL : https://cdn.lucee.org/express-templates/lucee-tomcat-11.0.13-template.zip
23+
1824jobs :
1925 # First job: Build the test extensions
2026 build-extensions :
@@ -68,39 +74,40 @@ jobs:
6874 java-version : 21
6975 distribution : temurin
7076
71- - name : Cache Lucee Express
72- uses : actions/cache@v4
73- with :
74- path : lucee-express-cache/
75- key : lucee-express-${{ matrix.luceeVersion }}
76-
77- - name : Cache Lucee downloads
78- uses : actions/cache@v4
79- with :
80- path : /home/runner/work/_actions/lucee/script-runner/main/lucee-download-cache
81- key : lucee-downloads
82-
8377 - name : Download slow-startup extension
8478 uses : actions/download-artifact@v4
8579 with :
8680 name : slow-startup-extension
8781 path : extensions/
8882
89- - name : Download Lucee Express
90- uses : lucee/script-runner@main
91- with :
92- webroot : ${{ github.workspace }}/custom/deployment-tests
93- execute : /fetch-express.cfm
94- luceeVersionQuery : ${{ matrix.luceeVersion }}
95- env :
96- fetch : ${{ matrix.luceeVersion }}
83+ - name : Download Lucee Express template
84+ run : |
85+ curl -L -o express-template.zip "$EXPRESS_TEMPLATE_URL"
86+ unzip -q express-template.zip -d express
87+
88+ - name : Download Lucee JAR
89+ run : |
90+ # Get Lucee JAR filename via update API
91+ LUCEE_FILENAME=$(curl -s "https://update.lucee.org/rest/update/provider/latest/${{ matrix.luceeVersion }}/filename" | tr -d '"')
92+ echo "Lucee filename: $LUCEE_FILENAME"
93+ LUCEE_URL="https://cdn.lucee.org/$LUCEE_FILENAME"
94+ echo "Downloading from: $LUCEE_URL"
95+ curl -L -f -o lucee.jar "$LUCEE_URL"
96+ # Validate JAR
97+ if ! unzip -t lucee.jar > /dev/null 2>&1; then
98+ echo "ERROR: Downloaded JAR is corrupt!"
99+ exit 1
100+ fi
101+ # Install into Express
102+ rm -f express/lib/lucee-*.jar
103+ cp lucee.jar express/lib/
97104
98105 - name : Prepare test environment
99106 run : |
100107 echo "## Test: ${{ matrix.luceeVersion }}" >> $GITHUB_STEP_SUMMARY
101108 echo "" >> $GITHUB_STEP_SUMMARY
102109
103- # Create test script in webroot
110+ # Copy test script to webroot
104111 cp custom/deployment-tests/test-slow-startup.cfm express/webapps/ROOT/
105112
106113 # Copy extension to deploy folder BEFORE starting Lucee
@@ -109,36 +116,53 @@ jobs:
109116 echo "Extension in deploy folder:"
110117 ls -la express/lucee-server/deploy/
111118
119+ # Configure trace logging
120+ echo 'export LUCEE_LOGGING_FORCE_LEVEL=trace' >> express/bin/setenv.sh
121+ chmod +x express/bin/setenv.sh
122+
123+ # Configure Tomcat port
124+ sed -i 's/port="8080"/port="8888"/g' express/conf/server.xml
125+
112126 - name : Start Lucee and test IMMEDIATELY (no sleep!)
113127 id : test
114128 run : |
115- # Start Lucee in background
116- ./express/bin/startup.sh
129+ cd express
130+
131+ # Start Lucee
132+ echo "Starting Lucee Express..."
133+ ./bin/catalina.sh start
134+ echo "Lucee started"
117135
118136 # Make request IMMEDIATELY - this is the key test!
119137 # If LDEV-5478 exists, this will fail because onStart() hasn't completed
120138 echo "Making immediate request (no delay)..."
121139
122- # Try up to 10 times with 1 second between attempts
123- # The first few might fail due to Tomcat not being ready yet
140+ # Try up to 30 times with 1 second between attempts
141+ # The first few will fail due to Tomcat not being ready yet
124142 # But once Tomcat IS ready, if the extension isn't, that's the bug!
125- for i in {1..10 }; do
143+ for i in {1..30 }; do
126144 echo "Attempt $i..."
127145 HTTP_CODE=$(curl -s -o /tmp/response.txt -w "%{http_code}" http://127.0.0.1:8888/test-slow-startup.cfm 2>/dev/null || echo "000")
128146 echo "HTTP Code: $HTTP_CODE"
129147 if [ "$HTTP_CODE" != "000" ]; then
130148 # Got a response from Tomcat
149+ echo "=== Response ==="
131150 cat /tmp/response.txt
132151 echo ""
152+ echo "================"
133153 if [ "$HTTP_CODE" = "200" ]; then
134154 echo "TEST PASSED: Extension ready on first request"
135155 echo "### Result: PASSED" >> $GITHUB_STEP_SUMMARY
156+ echo '```' >> $GITHUB_STEP_SUMMARY
136157 cat /tmp/response.txt >> $GITHUB_STEP_SUMMARY
158+ echo '```' >> $GITHUB_STEP_SUMMARY
137159 exit 0
138160 else
139161 echo "TEST FAILED: Extension NOT ready - LDEV-5478 reproduced!"
140162 echo "### Result: FAILED (LDEV-5478 reproduced)" >> $GITHUB_STEP_SUMMARY
163+ echo '```' >> $GITHUB_STEP_SUMMARY
141164 cat /tmp/response.txt >> $GITHUB_STEP_SUMMARY
165+ echo '```' >> $GITHUB_STEP_SUMMARY
142166 exit 1
143167 fi
144168 fi
@@ -152,38 +176,20 @@ jobs:
152176 - name : Stop Lucee
153177 if : always()
154178 run : |
155- ./express/bin/shutdown.sh || true
179+ cd express
180+ ./bin/shutdown.sh || true
156181
157- - name : Show Lucee logs
182+ - name : Show catalina.out
158183 if : always()
159184 run : |
160- echo "## Logs" >> $GITHUB_STEP_SUMMARY
161- echo "" >> $GITHUB_STEP_SUMMARY
185+ echo "=== catalina.out ==="
186+ cat express/logs/catalina.out || echo "No catalina.out found"
162187
163- echo "### catalina.out" >> $GITHUB_STEP_SUMMARY
164- if [ -f express/logs/catalina.out ]; then
165- echo '```' >> $GITHUB_STEP_SUMMARY
166- tail -100 express/logs/catalina.out >> $GITHUB_STEP_SUMMARY
167- echo '```' >> $GITHUB_STEP_SUMMARY
168- fi
169-
170- echo "### deploy.log" >> $GITHUB_STEP_SUMMARY
171- if [ -f express/lucee-server/context/logs/deploy.log ]; then
172- echo '```' >> $GITHUB_STEP_SUMMARY
173- cat express/lucee-server/context/logs/deploy.log >> $GITHUB_STEP_SUMMARY
174- echo '```' >> $GITHUB_STEP_SUMMARY
175- fi
176-
177- echo "### exception.log" >> $GITHUB_STEP_SUMMARY
178- if [ -f express/lucee-server/context/logs/exception.log ]; then
179- echo '```' >> $GITHUB_STEP_SUMMARY
180- cat express/lucee-server/context/logs/exception.log >> $GITHUB_STEP_SUMMARY
181- echo '```' >> $GITHUB_STEP_SUMMARY
182- fi
183-
184- echo "### out.log" >> $GITHUB_STEP_SUMMARY
185- if [ -f express/lucee-server/context/logs/out.log ]; then
186- echo '```' >> $GITHUB_STEP_SUMMARY
187- cat express/lucee-server/context/logs/out.log >> $GITHUB_STEP_SUMMARY
188- echo '```' >> $GITHUB_STEP_SUMMARY
189- fi
188+ - name : Upload logs on failure
189+ if : failure()
190+ uses : actions/upload-artifact@v4
191+ with :
192+ name : lucee-logs-${{ matrix.luceeVersion }}
193+ path : |
194+ express/logs/
195+ express/lucee-server/context/logs/
0 commit comments