Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for reusing cached channels #7123

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions qa/L0_grpc/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ for i in \
; do
BASE=$(basename -- $i)
SUFFIX="${BASE%.*}"
if [ $SUFFIX == "image_client" ]; then
if [[ $SUFFIX == "image_client" ]]; then
$i -m inception_graphdef -s INCEPTION -a -c 1 -b 1 -i grpc -u localhost:8001 $IMAGE >> "${CLIENT_LOG}.c++.async.${SUFFIX}" 2>&1
if [ `grep -c VULTURE ${CLIENT_LOG}.c++.async.${SUFFIX}` != "1" ]; then
echo -e "\n***\n*** Failed. Expected 1 VULTURE results\n***"
Expand All @@ -296,16 +296,24 @@ for i in \
# RET=1
# fi
# done
elif [ $BASE = ${SIMPLE_INFER_CLIENT} ]; then
elif [[ $BASE == "simple_grpc_infer_client" ]]; then
# Test forcing new channel creation with simple infer client
NEW_CHANNEL_STRING = "creating client_channel for channel stack"
NEW_CHANNEL_STRING="new connected subchannel"
CACHED_CHANNEL_STRING_NONE="There are 0 cached channels"
CACHED_CHANNEL_STRING_ONE="There are 1 cached channel"
GRPC_TRACE=subchannel GRPC_VERBOSITY=info $i -v -c "true" >> ${CLIENT_LOG}.c++.${SUFFIX} 2>&1
if [ $? -ne 0 ]; then
cat ${CLIENT_LOG}.c++.${SUFFIX}
RET=1
fi
if [ `grep -c ${NEW_CHANNEL_STRING} ${CLIENT_LOG}.c++.${SUFFIX}` != "1" ]; then
echo -e "\n***\n*** Failed. Expected 1 ${NEW_CHANNEL_STRING} calls\n***"
NUM_NEW_CHANNEL_CALLS=`grep -c "${NEW_CHANNEL_STRING}" ${CLIENT_LOG}.c++.${SUFFIX}`
if [ $NUM_NEW_CHANNEL_CALLS != "1" ]; then
echo -e "\n***\n*** Failed. Expected 1 ${NEW_CHANNEL_STRING} calls but got ${NUM_NEW_CHANNEL_CALLS}\n***"
cat $CLIENT_LOG.c++.${SUFFIX}
RET=1
fi
if [ `grep -c "${CACHED_CHANNEL_STRING_NONE}" ${CLIENT_LOG}.c++.${SUFFIX}` != "2" ]; then
echo -e "\n***\n*** Failed. Expected 0 cached channels\n***"
cat $CLIENT_LOG.c++.${SUFFIX}
RET=1
fi
Expand All @@ -314,8 +322,14 @@ for i in \
cat ${CLIENT_LOG}.c++.${SUFFIX}
RET=1
fi
if [ `grep -c ${NEW_CHANNEL_STRING} ${CLIENT_LOG}.c++.${SUFFIX}` != "2" ]; then
echo -e "\n***\n*** Failed. Expected 2 ${NEW_CHANNEL_STRING} calls\n***"
NUM_NEW_CHANNEL_CALLS=`grep -c "${NEW_CHANNEL_STRING}" ${CLIENT_LOG}.c++.${SUFFIX}`
if [ $NUM_NEW_CHANNEL_CALLS != "3" ]; then
echo -e "\n***\n*** Failed. Expected 2 ${NEW_CHANNEL_STRING} calls but got ${NUM_NEW_CHANNEL_CALLS}\n***"
cat $CLIENT_LOG.c++.${SUFFIX}
RET=1
fi
if [ `grep -c "${CACHED_CHANNEL_STRING_ONE}" ${CLIENT_LOG}.c++.${SUFFIX}` != "2" ]; then
echo -e "\n***\n*** Failed. Expected 1 cached channels\n***"
cat $CLIENT_LOG.c++.${SUFFIX}
RET=1
fi
Expand Down
Loading