<commit_before>#! /bin/bash
#####################################################################################
#                                                                                   #
#  Script to verify a WebSphere Liberty image                                       #
#                                                                                   #
#                                                                                   #
#  Usage : verify.sh <Image name>                                                   #
#                                                                                   #
#####################################################################################

image=$1
tag=`echo $image | cut -d ":" -f2`
cname="${tag}test"

waitForServerStart()
{
   cid=$1
   count=${2:-1}
   end=$((SECONDS+30))
   while (( $SECONDS < $end && $(docker inspect -f {{.State.Running}} $cid) == "true" ))
   do
      result=$(docker logs $cid |& grep "CWWKF0011I" | wc -l)
      if [ $result = $count ]
      then
         return 0
      fi
   done

   echo "Liberty failed to start the expected number of times"
   return 1 
}

testLibertyStarts()
{
   cid=$(docker run -d $image)
   if [ $? != 0 ]
   then
      echo "Failed to run container; exiting"
      exit 1<commit_msg>Increase server start timeout<commit_after>#! /bin/bash
#####################################################################################
#                                                                                   #
#  Script to verify a WebSphere Liberty image                                       #
#                                                                                   #
#                                                                                   #
#  Usage : verify.sh <Image name>                                                   #
#                                                                                   #
#####################################################################################

image=$1
tag=`echo $image | cut -d ":" -f2`
cname="${tag}test"

waitForServerStart()
{
   cid=$1
   count=${2:-1}
   end=$((SECONDS+60))
   while (( $SECONDS < $end && $(docker inspect -f {{.State.Running}} $cid) == "true" ))
   do
      result=$(docker logs $cid |& grep "CWWKF0011I" | wc -l)
      if [ $result = $count ]
      then
         return 0
      fi
   done

   echo "Liberty failed to start the expected number of times"
   return 1 
}

testLibertyStarts()
{
   cid=$(docker run -d $image)
   if [ $? != 0 ]
   then
      echo "Failed to run container; exiting"
      exit 1
{'fraction_non_alphanumeric': 0.2190332326283988, 'fraction_numerical': 0.011329305135951661, 'mean_word_length': 1.1225961538461537, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2209941', 'n_tokens_mistral': 618, 'n_tokens_neox': 572, 'n_words': 156}