github.com/pingcap/ticdc@v0.0.0-20220526033649-485a10ef2652/tests/_utils/check_logs (about)

     1  #!/bin/bash
     2  # parameter 1: work directory
     3  WORK_DIR=$1
     4  
     5  set +e
     6  
     7  ## check cdc state checker log
     8  if [ ! -f $WORK_DIR/cdc_etcd_check.log ]; then
     9      exit 0
    10  fi
    11  
    12  grep -q -i test-case-failed $WORK_DIR/cdc_etcd_check.log
    13  
    14  if [ $? -eq 0 ]; then
    15    echo "cdc state checker failed"
    16    exit 1
    17  else
    18    exit 0
    19  fi
    20  
    21  ## check data race
    22  if [ ! -f $WORK_DIR/stdout.log ]; then
    23      exit 0
    24  fi
    25  
    26  grep -q -i 'DATA RACE' $WORK_DIR/stdout.log
    27  
    28  if [ $? -eq 0 ]; then
    29    echo "found DATA RACE"
    30    exit 1
    31  else
    32    exit 0
    33  fi