[Git][java-team/vnu][master] 3 commits: vnu-server: increase timeout when using --return-when-ready

bastif (@bastif) gitlab at salsa.debian.org
Sat May 2 13:29:59 BST 2026



bastif pushed to branch master at Debian Java Maintainers / vnu


Commits:
0926c892 by Fab Stz at 2026-05-02T14:25:00+02:00
vnu-server: increase timeout when using --return-when-ready

This is required to let autopkgtest pass (on some slow architectures like
i386).

The previous 60 iterations were not enough.

- - - - -
4bda4116 by Fab Stz at 2026-05-02T14:27:46+02:00
README: Mention how to set JVM option '-Xss2048k' on i386

- - - - -
826f3421 by Fab Stz at 2026-05-02T14:28:49+02:00
d/tests: set -Xss2048k JVM option on i386 when run inside jetty/tomcat

This will fix autopkgtest on i386 with vnu-jetty & vnu-tomcat packages

- - - - -


5 changed files:

- debian/java-wrappers/vnu-server.in
- debian/tests/webapp_validate_common.sh
- debian/vnu-jetty12.README.Debian
- debian/vnu-jetty9.README.Debian
- debian/vnu-tomcat11.README.Debian


Changes:

=====================================
debian/java-wrappers/vnu-server.in
=====================================
@@ -5,6 +5,34 @@ set -e
 # Include the wrappers utility script
 . /usr/lib/java-wrappers/java-wrappers.sh
 
+wait_until_ready()
+{
+  local server port count count_max
+  server="$1"
+  port="$2"
+  path="$3"
+  count=0
+  count_max=180
+  echo "Waiting until servlet on $server is ready at http://localhost:${port}/$path"
+  TIMEFORMAT='Elapsed time is %R seconds.'
+  { time {
+  while ! nc -z localhost "${port}" >/dev/null 2>&1 && [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:${port}/$path)" != "200" ]]; do
+    if [ $count -gt $count_max ]; then
+      break
+    fi
+    count=$((count + 1))
+    sleep 1
+  done
+  } } 2>&1
+  if [ ! $count -gt $count_max ]; then
+    echo "Success."
+  else
+    echo "Failed (reached max count '$count_max')." >&2
+    debug_failure >&2
+    exit 1
+  fi
+}
+
 find_java_runtime default
 
 if [ -z "$PATH_TO_VNU_JAR" ]; then
@@ -78,23 +106,8 @@ if nc -z localhost "${PORT:-8888}" >/dev/null 2>&1; then
 fi
 
 if [ "$RETURN_WHEN_READY" = 1 ]; then
-  count=0
   run_java nu.validator.servlet.Main "${ARGS[@]}" &
-  while ! nc -z localhost "${PORT:-8888}" >/dev/null 2>&1; do
-    if [ $count -gt 60 ]; then
-      break
-    fi
-    count=$((count + 1))
-    sleep 1
-  done
-  if [ ! $count -gt 60 ]; then
-    echo "v.Nu (Nu Html Checker) is now up and running at http://localhost:${PORT:-8888}"
-    echo "Startup took $count seconds."
-    exit
-  else
-    echo "v.Nu (Nu Html Checker) failed starting up in less than 60 seconds"
-    exit 1
-  fi
+  wait_until_ready vnu-server "${PORT:-8888}" ""
 else
   run_java nu.validator.servlet.Main "${ARGS[@]}"
 fi


=====================================
debian/tests/webapp_validate_common.sh
=====================================
@@ -78,8 +78,24 @@ start_server()
   path="$3"
   if [ -n "$AUTOPKGTEST_TMP" ]; then
     case "$server" in
+    jetty9)
+      if [ "$(dpkg --print-architecture)" = "i386" ]; then
+        echo "Adding -Xss2048k JVM option."
+        sudo echo -e '[Service]\nEnvironment="JAVA_OPTIONS=-Xss2048k"' | systemctl edit --drop-in vnu-jetty9.conf --stdin jetty9.service
+      fi
+      ;;
+    jetty12)
+      if [ "$(dpkg --print-architecture)" = "i386" ]; then
+        echo "Adding -Xss2048k JVM option."
+        sudo echo -e '[Service]\nEnvironment="JAVA_OPTIONS=-Xss2048k"' | systemctl edit --drop-in vnu-jetty12.conf --stdin jetty12.service
+      fi
+      ;;
     tomcat11)
       sudo sed -i '/common.loader/ s#$#,/usr/share/tomcat-jakartaee-migration/lib/*.jar#' "/etc/tomcat11/catalina.properties"
+      if [ "$(dpkg --print-architecture)" = "i386" ]; then
+        echo "Adding -Xss2048k JVM option."
+        sudo echo -e '[Service]\nEnvironment="CATALINA_OPTS=-Xss2048k"' | systemctl edit --drop-in vnu-tomcat11.conf --stdin tomcat11.service
+      fi
       ;;
     esac
 


=====================================
debian/vnu-jetty12.README.Debian
=====================================
@@ -1,3 +1,15 @@
 With jetty12, vnu webapp is reachable at:
 
   http://localhost:8080/vnu
+
+If running on i386 architecture, you also have to launch jetty with the
+following JVM option "-Xss2048k".
+
+To achieved this, you could set the JAVA_OPTIONS environment variable this way.
+
+  echo -e '[Service]\nEnvironment="JAVA_OPTIONS=-Xss2048k"' | \
+    systemctl edit --drop-in vnu-jetty12.conf --stdin jetty12.service
+
+Then restart the service:
+
+  systemctl restart jetty12


=====================================
debian/vnu-jetty9.README.Debian
=====================================
@@ -1,3 +1,15 @@
 With jetty9, vnu webapp is reachable at:
 
   http://localhost:8080/vnu
+
+If running on i386 architecture, you also have to launch jetty with the
+following JVM option "-Xss2048k".
+
+To achieved this, you could set the JAVA_OPTIONS environment variable this way.
+
+  echo -e '[Service]\nEnvironment="JAVA_OPTIONS=-Xss2048k"' | \
+    systemctl edit --drop-in vnu-jetty9.conf --stdin jetty9.service
+
+Then restart the service:
+
+  systemctl restart jetty9


=====================================
debian/vnu-tomcat11.README.Debian
=====================================
@@ -13,3 +13,14 @@ Notice: at the time of writing this, there is a bug report on this. See:
 With tomcat11, vnu webapp is reachable at:
 
   http://localhost:8080/vnu
+
+If running on i386 architecture, you also have to launch tomcat with the
+following JVM option "-Xss2048k".
+
+To achieved this, you could set the CATALINA_OPTS environment variable this way.
+  echo -e '[Service]\nEnvironment="CATALINA_OPTS=-Xss2048k"' | \
+    systemctl edit --drop-in vnu-tomcat11.conf --stdin tomcat11.service
+
+Then restart the service:
+
+  systemctl restart tomcat11



View it on GitLab: https://salsa.debian.org/java-team/vnu/-/compare/e732da9907d204e8913bc011da8dd58c503fd9ef...826f34219d673b7493a76e54909dad4585ce0a1e

-- 
View it on GitLab: https://salsa.debian.org/java-team/vnu/-/compare/e732da9907d204e8913bc011da8dd58c503fd9ef...826f34219d673b7493a76e54909dad4585ce0a1e
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20260502/34a2484c/attachment.htm>


More information about the pkg-java-commits mailing list