Skip to content

Commit

Permalink
issue: 3249310 CI Valgrind stability and logs
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Grissik <[email protected]>
  • Loading branch information
AlexanderGrissik committed Nov 10, 2022
1 parent 73a4dae commit 6a4401f
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions contrib/jenkins_tests/vg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ v1=$(($v1*$(echo $test_ip_list | wc -w)))
echo "1..$v1" > $vg_tap

nerrors=0
sockperf_max_wait=120

for test_link in $test_ip_list; do
for test in $test_list; do
Expand All @@ -75,11 +76,22 @@ for test_link in $test_ip_list; do
"
eval "${sudo_cmd} LD_PRELOAD=$test_lib \
${vg_tool} --log-file=${vg_dir}/${test_name}-valgrind-sr.log $vg_args \
$test_app_path sr ${test_opt} -i ${test_ip} > /dev/null 2>&1 &"
sleep 30
$test_app_path sr ${test_opt} -i ${test_ip} 2>&1 | tee ${vg_dir}/${test_name}-output-sr.log &"

wait=0
while [ $wait -lt $sockperf_max_wait ]; do
ret=$(cat ${vg_dir}/${test_name}-output-sr.log | grep 'sockperf: Warmup stage' | wc -l)
if [ $ret -gt 0 ]; then
wait=$sockperf_max_wait
else
wait=$(( $wait + 2 ))
fi
sleep 2
done

eval "${sudo_cmd} LD_PRELOAD=$test_lib \
${vg_tool} --log-file=${vg_dir}/${test_name}-valgrind-cl.log $vg_args \
$test_app_path pp ${test_opt} -i ${test_ip} -t 10"
$test_app_path pp ${test_opt} -i ${test_ip} -t 10 | tee ${vg_dir}/${test_name}-output-cl.log"

if [ `ps -ef | grep $test_app | wc -l` -gt 1 ];
then
Expand All @@ -98,17 +110,26 @@ for test_link in $test_ip_list; do
fi

sleep 10
do_archive "${vg_dir}/${test_name}-valgrind*.log ${vg_dir}/${test_name}-output*.log"
ret=$(cat ${vg_dir}/${test_name}-valgrind*.log | awk '/ERROR SUMMARY: [0-9]+ errors?/ { sum += $4 } END { print sum }')

do_archive "${vg_dir}/${test_name}-valgrind*.log"

if [ $ret -gt 0 ]; then
echo "not ok ${test_name}: valgrind Detected $ret failures # ${vg_dir}/${test_name}-valgrind*.log" >> $vg_tap
grep -A 10 'LEAK SUMMARY' ${vg_dir}/${test_name}-valgrind*.log >> ${vg_dir}/${test_name}-valgrind.err
cat ${vg_dir}/${test_name}-valgrind*.log
do_err "valgrind" "${vg_dir}/${test_name}-valgrind.err"
else
echo ok ${test_name}: Valgrind found no issues >> $vg_tap
ret=$(cat ${vg_dir}/${test_name}-output*.log | grep 'Summary: Latency is' | wc -l)
if [ $ret -le 0 ]; then
echo "not ok ${test_name}: valgrind Detected $ret failures # ${vg_dir}/${test_name}-output*.log" >> $vg_tap
grep -A 10 'sockperf:' ${vg_dir}/${test_name}-output*.log >> ${vg_dir}/${test_name}-output.err
cat ${vg_dir}/${test_name}-output*.log
do_err "valgrind" "${vg_dir}/${test_name}-output.err"
ret=1
else
ret=0
echo ok ${test_name}: Valgrind found no issues >> $vg_tap
fi
fi
nerrors=$(($ret+$nerrors))
done
Expand Down

0 comments on commit 6a4401f

Please sign in to comment.