Skip to content

Commit 1df47fe

Browse files
committed
CI: check-logs.sh add wait for OpenSearch connection
Change-Id: Ib8a93336e41f7fa326d3a4be53f757fee3923643 Signed-off-by: Michal Nasiadka <[email protected]> (cherry picked from commit 47c7810)
1 parent 232ac39 commit 1df47fe

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/check-logs.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,22 @@ if sudo test -d /var/log/kolla; then
182182
fi
183183
done
184184

185+
# NOTE: Check if OpenSearch output plugin has connected in OpenSearch scenarios, otherwise
186+
# check_fluentd_missing_logs will fail because fluentd will only parse files when
187+
# output plugin is working.
188+
retries=0
189+
retries_max=10
190+
until [[ $(sudo tail -n 5 /var/log/kolla/fluentd/fluentd.log | grep "Could not communicate to OpenSearch" | wc -l) -eq 0 ]]; do
191+
echo "Found 'Could not communicate to OpenSearch' in last 5 lines of fluentd.log, sleeping 30 seconds"
192+
retries=$((retries + 1))
193+
if [[ $retries != $retries_max ]]; then
194+
sleep 30
195+
else
196+
echo "Found 'Could not communicate to OpenSearch' in last 5 lines of fluentd.log after 10 retries." | tee -a $fluentd_error_summary_file
197+
break
198+
fi
199+
done
200+
185201
if check_fluentd_missing_logs >/dev/null; then
186202
any_critical=1
187203
echo "(critical) Found some missing log files in fluentd logs. Matches in $fluentd_error_summary_file"

0 commit comments

Comments
 (0)