Skip to content

Commit

Permalink
SQL-2248: Fix integration test hang on amazon2-arm64 host (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
bucaojit authored Aug 2, 2024
1 parent 401a6ed commit f68c471
Showing 1 changed file with 49 additions and 4 deletions.
53 changes: 49 additions & 4 deletions .evg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ buildvariants:
tasks:
- name: "build"
- name: "test-unit"
# SQL-2248: Fix integration test hang
# - name: "test-integration"
- name: "test-integration"

- name: release
display_name: "Release"
Expand Down Expand Up @@ -361,9 +360,55 @@ functions:
${PREPARE_SHELL}
./resources/run_adf.sh start &&
./gradlew -Dorg.gradle.java.home=${JAVA_HOME} runDataLoader &&
./gradlew -Dorg.gradle.java.home=${JAVA_HOME} clean integrationTest -x test
EXITCODE=$?
./gradlew -Dorg.gradle.java.home=${JAVA_HOME} clean integrationTest \
-x test > gradle_output.log 2>&1 &
GRADLE_PID=$!
echo "Gradle process started with PID $GRADLE_PID"
# On Amazon Linux 2 hosts, the gradlew integrationTest command was hanging indefinitely.
# This monitoring approach will detect build completion or failure even when the Gradle
# process doesn't terminate properly and allows the task to complete.
SECONDS=0
TIMEOUT=1800 # 30 minute timeout
while true; do
if grep -q "BUILD SUCCESSFUL" gradle_output.log; then
echo "Build successful!"
EXITCODE=0
break
fi
if grep -q "BUILD FAILED" gradle_output.log; then
echo "Build failed!"
EXITCODE=1
break
fi
if (( SECONDS > TIMEOUT )); then
echo "$TIMEOUT second timeout reached. Exiting with failure."
EXITCODE=1
break
fi
# Check if Gradle process is still running
if ! kill -0 $GRADLE_PID 2>/dev/null; then
echo "Gradle process has finished."
wait $GRADLE_PID
EXITCODE=$?
break
fi
sleep 5
done
cat gradle_output.log
kill $GRADLE_PID 2>/dev/null || true
./resources/run_adf.sh stop
echo "Integration test exit code: $EXITCODE"
exit $EXITCODE
"trace artifacts":
Expand Down

0 comments on commit f68c471

Please sign in to comment.