<commit_before>#!/bin/bash

set -eo pipefail

dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"

image="$1"

cname="silverpeas-container-$RANDOM-$RANDOM"

# when running the first time, a silverpeas process is spawn before starting Silverpeas
# (this configuration process can take some time)
cid="$(docker run -d -e DB_SERVERTYPE="H2" -e DB_SERVER=":file:" -e DB_PASSWORD="sa" --name "$cname" "$image")"
trap "docker rm -vf $cid > /dev/null" EXIT

# the maximum time for Silverpeas to be configured and to be started (if no errors)
sleep 120s

silverpeas_status="$(docker exec "$cname" /opt/silverpeas/bin/silverpeas status)"

[ "`echo $silverpeas_status`" = "Configured: [OK] Running: [OK] Active: [OK] INFO: JBoss is running" ]
<commit_msg>As suggested by Tianon, replace the sleep command by the use of the retry.sh script<commit_after>#!/bin/bash

set -eo pipefail

dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"

image="$1"

cname="silverpeas-container-$RANDOM-$RANDOM"

# when running the first time, a silverpeas process is spawn before starting Silverpeas
# (this configuration process can take some time)
cid="$(docker run -d -e DB_SERVERTYPE="H2" -e DB_SERVER=":file:" -e DB_PASSWORD="sa" --name "$cname" "$image")"
trap "docker rm -vf $cid > /dev/null" EXIT

check_running() {
  docker run --rm --link "$cid":silverpeas "$image" wget silverpeas:8000/silverpeas &>/dev/null
  return $?
}

. "$dir/../../retry.sh" --tries 20 --sleep 5 'check_running'

silverpeas_status="$(docker exec "$cname" /opt/silverpeas/bin/silverpeas status)"

[ "`echo $silverpeas_status`" = "Configured: [OK] Running: [OK] Active: [OK] INFO: JBoss is running" ]

{'fraction_non_alphanumeric': 0.16009702850212248, 'fraction_numerical': 0.008489993935718617, 'mean_word_length': 4.892857142857143, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2959492', 'n_tokens_mistral': 610, 'n_tokens_neox': 588, 'n_words': 180}