Skip to content

Commit

Permalink
track driver start time in the e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyXiangLi committed Mar 24, 2021
1 parent a4d4871 commit 2eec738
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions hack/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ source "${BASE_DIR}"/util.sh

DRIVER_NAME=${DRIVER_NAME:-aws-ebs-csi-driver}
CONTAINER_NAME=${CONTAINER_NAME:-ebs-plugin}
DRIVER_START_TIME_THRESHOLD=20

TEST_ID=${TEST_ID:-$RANDOM}
CLUSTER_NAME=test-cluster-${TEST_ID}.k8s.local
Expand Down Expand Up @@ -104,18 +105,29 @@ if [[ $? -ne 0 ]]; then
fi

loudecho "Deploying driver"
startSec=$(date +'%s')
"${HELM_BIN}" upgrade --install "${DRIVER_NAME}" \
--namespace kube-system \
--set image.repository="${IMAGE_NAME}" \
--set image.tag="${IMAGE_TAG}" \
-f "${HELM_VALUES_FILE}" \
--wait
./charts/"${DRIVER_NAME}"

if [[ -r "${EBS_SNAPSHOT_CRD}" ]]; then
loudecho "Deploying snapshot CRD"
kubectl apply -f "$EBS_SNAPSHOT_CRD"
# TODO deploy snapshot controller too instead of including in helm chart
fi
endSec=$(date +'%s')
secondUsed=$(( (endSec-startSec)/1 ))
# Set timeout threshold as 20 seconds for now, usually it takes less than 10s to startup
if [ $secondUsed -gt $DRIVER_START_TIME_THRESHOLD ]; then
loudecho "Driver start timeout, test fail!"
exit 1
fi
loudecho "Driver deployment complete, time used: $secondUsed seconds"


loudecho "Testing focus ${GINKGO_FOCUS}"
eval "EXPANDED_TEST_EXTRA_FLAGS=$TEST_EXTRA_FLAGS"
Expand Down

0 comments on commit 2eec738

Please sign in to comment.