Skip to content

Commit

Permalink
update test file and handled the null case
Browse files Browse the repository at this point in the history
Signed-off-by: Saad Khan <[email protected]>
  • Loading branch information
khansaad committed Dec 15, 2023
1 parent 75b7b93 commit fe99cb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ public void loadAllResults(Map<String, KruizeObject> mainKruizeExperimentMap) th
List<ExperimentResultData> resultDataList = new ArrayList<>();
for (UpdateResultsAPIObject updateResultsAPIObject : updateResultsAPIObjects) {
try {
ExperimentResultData experimentResultData = Converters.KruizeObjectConverters.convertUpdateResultsAPIObjToExperimentResultData(updateResultsAPIObject);
ExperimentResultData experimentResultData = null;
if (updateResultsAPIObject.getKruizeObject() != null)
experimentResultData = Converters.KruizeObjectConverters.convertUpdateResultsAPIObjToExperimentResultData(updateResultsAPIObject);
if (experimentResultData != null)
resultDataList.add(experimentResultData);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ echo ""
echo "Running fault tolerant test for kruize on ${CLUSTER_TYPE}" | tee -a ${LOG}
if [ "${CLUSTER_TYPE}" == "openshift" ]; then
echo "python3 kruize_pod_restart_test.py -c ${CLUSTER_TYPE} -a ${SERVER_IP_ADDR} -u ${num_exps} -d ${iterations} -r ${LOG_DIR} | tee -a ${TEST_LOG}" | tee -a ${LOG}
python3 kruize_pod_restart_test.py -c ${CLUSTER_TYPE} -a ${SERVER_IP_ADDR} -u ${num_exps} -d ${iterations} -r "${LOG_DIR}"
python3 kruize_pod_restart_test.py -c ${CLUSTER_TYPE} -a ${SERVER_IP_ADDR} -u ${num_exps} -d ${iterations} -r "${LOG_DIR}" | tee -a ${TEST_LOG}
exit_code=$?
echo "exit_code = $exit_code"

else
echo "python3 kruize_pod_restart_test.py -c ${CLUSTER_TYPE} -u ${num_exps} -d ${iterations} -r ${LOG_DIR} | tee -a ${TEST_LOG}" | tee -a ${LOG}
python3 kruize_pod_restart_test.py -c ${CLUSTER_TYPE} -u ${num_exps} -d ${iterations} -r "${LOG_DIR}"
python3 kruize_pod_restart_test.py -c ${CLUSTER_TYPE} -u ${num_exps} -d ${iterations} -r "${LOG_DIR}" | tee -a ${TEST_LOG}
exit_code=$?
echo "exit_code = $exit_code"
fi
Expand All @@ -174,7 +174,7 @@ if [ "${exit_code}" -ne 0 ]; then
echo "Fault tolerant test failed! Check the log for details" | tee -a ${LOG}
exit 1
else
if [[ $(grep -i "error\|exception" ${KRUIZE_POD_LOG_BEFORE}) || $(grep -i "error\|exception" ${KRUIZE_POD_LOG_AFTER}) ]]; then
if [[ $(grep -i "ERROR" ${KRUIZE_POD_LOG_BEFORE}) || $(grep -i "error\|exception" ${KRUIZE_POD_LOG_AFTER}) ]]; then
echo "Fault tolerant test failed! Check the logs for details" | tee -a ${LOG}
exit 1
else
Expand Down

0 comments on commit fe99cb7

Please sign in to comment.