summaryrefslogtreecommitdiff
path: root/scripts/check_race_conditions
blob: 9ddecdc13a9ccd8e3c53399ba3f7421ee6323a40 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

# This is the number of race conditions detected on master.
# This number is not allowed to increase, and it has to be lowered when we
# fix existing race conditions
max=33

tmpFile=$(mktemp)

find .testoutput/

grep -E "^WARNING: DATA RACE$" .testoutput/*.race.output.txt > ${tmpFile}

cnt=$(cat ${tmpFile} | wc -l)
echo "Found ${cnt} race conditions. Maximum allowed value is ${max}"

rm "$tmpFile" 2>/dev/null || true

if [ "${cnt}" -gt "${max}" ]; then
  echo "Race conditions count increased"
  exit 1
fi