diff options
| author | Mark Goddard <mark@stackhpc.com> | 2019-12-05 14:14:49 +0000 |
|---|---|---|
| committer | Radosław Piliszek <radoslaw.piliszek@gmail.com> | 2019-12-08 08:36:33 +0000 |
| commit | 2f7640d3965118a522b5fb18e66d5455ae132b87 (patch) | |
| tree | db6af2612400faeffdd81b287b3d26c12ba335eb /tests/check-logs.sh | |
| parent | 58b5acbf65013f468db3fe73349689271a3c287e (diff) | |
| download | kolla-ansible-2f7640d3965118a522b5fb18e66d5455ae132b87.tar.gz kolla-ansible-2f7640d3965118a522b5fb18e66d5455ae132b87.zip | |
CI: Don't fail on expected critical log messages
There is a number of critical log messages that we see in CI from time
to time. While these should be fixed, let's not fail jobs unnecessarily.
This change introduces one expected critical message in
placement-api.log:
Failed to fetch token data from identity server
Co-authored-by: Radosław Piliszek <radoslaw.piliszek@gmail.com>
Related-bug: #1847727
Change-Id: I92ad0be70ed05925612f0c709907ab62280326b8
Diffstat (limited to 'tests/check-logs.sh')
| -rwxr-xr-x | tests/check-logs.sh | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/check-logs.sh b/tests/check-logs.sh index c298dd386..2d8de9d7b 100755 --- a/tests/check-logs.sh +++ b/tests/check-logs.sh @@ -16,6 +16,25 @@ function check_file_for_level { sudo egrep " $2 " $1 | egrep -v "(logging_exception_prefix|rate_limit_except_level)" } +function filter_out_expected_critical { + # $1: file + # Filter out expected critical log messages that we do not want to fail the + # job. + + case $1 in + */placement-api.log) + # Sometimes we see this during upgrade when keystone is down. + grep -v "Failed to fetch token data from identity server" + ;; + *) + # We have to provide some pass-through consumer to avoid: + # grep: write error: Broken pipe + # from check_file_for_level + cat + ;; + esac +} + any_critical=0 for level in CRITICAL ERROR WARNING; do all_file=/tmp/logs/kolla/all-${level}.log @@ -27,7 +46,9 @@ for level in CRITICAL ERROR WARNING; do if check_file_for_level $f $level >/dev/null; then any_matched=1 if [[ $level = CRITICAL ]]; then - any_critical=1 + if check_file_for_level $f $level | filter_out_expected_critical $f >/dev/null; then + any_critical=1 + fi fi echo $f >> $all_file check_file_for_level $f $level >> $all_file |
