github.com/nilium/gitlab-runner@v12.5.0+incompatible/scripts/check_race_conditions (about)

     1  #!/bin/sh
     2  
     3  # This is the number of race conditions detected on master.
     4  # This number is not allowed to increase, and it has to be lowered when we
     5  # fix existing race conditions
     6  max=33
     7  
     8  tmpFile=$(mktemp)
     9  
    10  find .testoutput/
    11  
    12  grep -E "^WARNING: DATA RACE$" .testoutput/*.race.output.txt > ${tmpFile}
    13  
    14  cnt=$(cat ${tmpFile} | wc -l)
    15  echo "Found ${cnt} race conditions. Maximum allowed value is ${max}"
    16  
    17  rm "$tmpFile" 2>/dev/null || true
    18  
    19  if [ "${cnt}" -gt "${max}" ]; then
    20    echo "Race conditions count increased"
    21    exit 1
    22  fi