<commit_before>#!/bin/bash -x

set -o errexit    # abort script at first error

function testImage() {
  local tagname=$1
  local port=$2
  docker run -d -p $port:8080 --name=$tagname blacklabelops/jenkins:$tagname
  sleep 10
  curl --retry 10 --retry-delay 10 -v http://localhost:$port
  docker stop $tagname
}

testImage $1 $2
<commit_msg>Improved test routine with 5 minutes retry.<commit_after>#!/bin/bash -x

set -o errexit    # abort script at first error

function testImage() {
  local tagname=$1
  local port=$2
  local iteration=0
  docker run -d -p $port:8080 --name=$tagname blacklabelops/jenkins:$tagname
  while ! curl -v http://localhost:$port
  do
      { echo "Exit status of curl: $?"
        echo "Retrying ..."
      } 1>&2
      if [ "$iteration" = '30' ]; then
        break
      else
        ((iteration=iteration+1))
      fi
      sleep 10
  done
  docker stop $tagname
}

testImage $1 $2

{'fraction_non_alphanumeric': 0.12349726775956284, 'fraction_numerical': 0.033879781420765025, 'mean_word_length': 2.708502024291498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3473342', 'n_tokens_mistral': 334, 'n_tokens_neox': 315, 'n_words': 99}