|
25 | 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 | 26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
|
28 | | -CLIENT_PY=../python_unittest.py |
| 28 | +CLIENT_PY=../test_infer_shm_leak.py |
29 | 29 | CLIENT_LOG="./bls_client.log" |
30 | 30 | TEST_RESULT_FILE='test_results.txt' |
31 | 31 | source ../../common/util.sh |
32 | 32 |
|
33 | 33 | TRITON_REPO_ORGANIZATION=${TRITON_REPO_ORGANIZATION:=http://github.com/triton-inference-server} |
34 | 34 |
|
35 | 35 | RET=0 |
36 | | -rm -fr *.log ./models *.txt |
| 36 | +rm -fr *.log ./models *.txt *.xml |
37 | 37 |
|
38 | 38 | # FIXME: [DLIS-5970] Until Windows supports GPU tensors, only test CPU |
39 | 39 | if [[ ${TEST_WINDOWS} == 0 ]]; then |
@@ -119,30 +119,35 @@ if [[ ${TEST_WINDOWS} == 0 ]]; then |
119 | 119 |
|
120 | 120 | for MODEL_NAME in bls bls_memory bls_memory_async bls_async; do |
121 | 121 | export MODEL_NAME=${MODEL_NAME} |
122 | | - |
123 | | - python3 -m pytest --junitxml="${MODEL_NAME}.${TRIAL}.${CUDA_MEMORY_POOL_SIZE_MB}.report.xml" $CLIENT_PY >> $CLIENT_LOG 2>&1 |
124 | | - if [ $? -ne 0 ]; then |
| 122 | + # Run with pytest to capture the return code correctly |
| 123 | + pytest --junitxml="${MODEL_NAME}.${TRIAL}.${CUDA_MEMORY_POOL_SIZE_MB}.report.xml" $CLIENT_PY >> $CLIENT_LOG 2>&1 |
| 124 | + EXIT_CODE=$? |
| 125 | + if [ $EXIT_CODE -ne 0 ]; then |
125 | 126 | echo -e "\n***\n*** ${MODEL_NAME} ${BLS_KIND} test FAILED. \n***" |
| 127 | + RET=$EXIT_CODE |
126 | 128 | cat $SERVER_LOG |
127 | 129 | cat $CLIENT_LOG |
128 | | - RET=1 |
129 | 130 | fi |
130 | 131 | done |
131 | 132 |
|
132 | | - set -e |
133 | | - |
134 | 133 | kill_server |
135 | 134 |
|
136 | | - # Check for bls 'test_timeout' to ensure timeout value is being correctly passed |
137 | | - if [ `grep -c "Request timeout: 11000000000" $SERVER_LOG` == "0" ]; then |
138 | | - echo -e "\n***\n*** BLS timeout value not correctly passed to model: line ${LINENO}\n***" |
139 | | - cat $SERVER_LOG |
140 | | - RET=1 |
| 135 | + set -e |
| 136 | + |
| 137 | + # Only check the timeout value if there is no error since the test |
| 138 | + # may fail before the test_timeout case gets run. |
| 139 | + if [ $RET -eq 0 ]; then |
| 140 | + # Check for bls 'test_timeout' to ensure timeout value is being correctly passed |
| 141 | + if [ `grep -c "Request timeout: 11000000000" $SERVER_LOG` == "0" ]; then |
| 142 | + echo -e "\n***\n*** BLS timeout value not correctly passed to model: line ${LINENO}\n***" |
| 143 | + cat $SERVER_LOG |
| 144 | + RET=1 |
| 145 | + fi |
141 | 146 | fi |
142 | 147 |
|
143 | | - if [[ $CUDA_MEMORY_POOL_SIZE_MB -eq 128 ]]; then |
| 148 | + if [[ $CUDA_MEMORY_POOL_SIZE_MB -eq 256 ]]; then |
144 | 149 | if [ `grep -c "Failed to allocate memory from CUDA memory pool" $SERVER_LOG` != "0" ]; then |
145 | | - echo -e "\n***\n*** Expected to use CUDA memory pool for all tests when CUDA_MEMOY_POOL_SIZE_MB is 128 MB for 'bls' $BLS_KIND test\n***" |
| 150 | + echo -e "\n***\n*** Expected to use CUDA memory pool for all tests when CUDA_MEMORY_POOL_SIZE_MB is 256 MB for 'bls' $BLS_KIND test\n***" |
146 | 151 | cat $SERVER_LOG |
147 | 152 | RET=1 |
148 | 153 | fi |
@@ -342,10 +347,10 @@ set -e |
342 | 347 |
|
343 | 348 | kill_server |
344 | 349 |
|
345 | | -if [ $RET -eq 1 ]; then |
346 | | - echo -e "\n***\n*** BLS test FAILED. \n***" |
347 | | -else |
| 350 | +if [ $RET -eq 0 ]; then |
348 | 351 | echo -e "\n***\n*** BLS test PASSED. \n***" |
| 352 | +else |
| 353 | + echo -e "\n***\n*** BLS test FAILED. \n***" |
349 | 354 | fi |
350 | 355 |
|
351 | 356 | exit $RET |
0 commit comments