Skip to content

Commit

Permalink
fix start build by adjusting the search message in the mvn output
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo committed Dec 20, 2024
1 parent 4ed70cc commit f8fe249
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/pit/lib/lib-demos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ getReadyMessageDev() {
vaadin-flow-karaf-example) echo "Artifact deployed";;
spreadsheet-demo|layout-examples) echo "Started ServerConnector";;
mpr-demo) echo "Vaadin is running in DEBUG MODE";;
start) echo "Restarting due to";;
start) echo "Application running at http:";;
*-gradle|flow-spring-examples) echo "Tomcat started|started and listening";;
*) echo "Frontend compiled successfully|Started .*Application|Started Server";;
esac
Expand Down
7 changes: 4 additions & 3 deletions scripts/pit/lib/lib-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ waitUntilMessageInFile() {
__message="$2"
__timeout="$3"
__cmd="$4"
__sleep=4
[ -n "$TEST" ] && cmd "## Wait for: '$__message'" || log "Waiting for server to start, timeout=$__timeout secs, message='$__message'"
[ -n "$TEST" ] && return 0
while [ $__timeout -gt 0 ]
Expand All @@ -249,10 +250,10 @@ waitUntilMessageInFile() {
&& H=`egrep "$__message" $__file | eval "$__perl" | head -1` \
&& log "Found '$H' in $__file after $__lasted secs" \
&& echo ">>>> PiT: Found '$H' after $__lasted secs" >> "$__file" \
&& sleep 3 && return 0
sleep 10 && __timeout=`expr $__timeout - 2`
&& sleep $__sleep && return 0
sleep $__sleep && __timeout=`expr $__timeout - $__sleep`
done
reportOutErrors "$__file" "Error could not find '$__message' in $__file after $__timeout secs"
reportOutErrors "$__file" "Timeout: could not find '$__message' in $__file after $3 secs"
return 1
}

Expand Down
7 changes: 5 additions & 2 deletions scripts/pit/lib/lib-validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ runValidations() {
[ -n "$7" ] && check="$7" || check=""
[ -n "$8" ] && test="$PIT_SCR_FOLDER/its/$8" || test=""

## start takes a long to compile the frontend in dev-mode
[ "$name" = "start" -a "$TIMEOUT" -le "300" ] && timeout=500 || timeout="$TIMEOUT"

file="$name-$mode-$version-"`uname`".out"
rm -f $file
[ "$mode" = prod ] && expr "$compile" : "$MVN" >/dev/null && compile="$compile -Dmaven.compiler.showDeprecation"
Expand Down Expand Up @@ -76,7 +79,7 @@ runValidations() {
runInBackgroundToFile "$cmd" "$file" "$VERBOSE"

# 5
waitUntilMessageInFile "$file" "$check" "$TIMEOUT" "$cmd" || return 1
waitUntilMessageInFile "$file" "$check" "$timeout" "$cmd" || return 1
waitUntilAppReady "$name" "$port" 60 "$file" || return 1

# 6
Expand All @@ -97,7 +100,7 @@ runValidations() {
killAll
mv "$file" "$file.tsconfig"
runInBackgroundToFile "$cmd" "$file" "$VERBOSE"
waitUntilMessageInFile "$file" "$check" "$TIMEOUT" "$cmd" || return 1
waitUntilMessageInFile "$file" "$check" "$timeout" "$cmd" || return 1
waitUntilAppReady "$name" "$port" 60 "$file" || return 1
waitUntilFrontendCompiled "http://localhost:$port/" "$file" || return 1
elif [ "$_err" != 0 ]; then
Expand Down

0 comments on commit f8fe249

Please sign in to comment.