Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit ca73ac1

Browse files
committed
tests: wait for volume to be bounded
Sometimes the volume is not bounded immediately. Instead of checking the status of the pvc right away after it is created, check for the status every 2 sec to a maximum of 10 sec. If not bounded on the 10th sec, then we fail. Fixes: #1006. Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
1 parent 1ad429f commit ca73ac1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

integration/kubernetes/k8s-volume.bats

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ setup() {
2525
}
2626

2727
@test "Create Persistent Volume" {
28+
wait_time=10
29+
sleep_time=2
2830
volume_name="pv-volume"
2931
volume_claim="pv-claim"
3032

@@ -38,7 +40,8 @@ setup() {
3840
sudo -E kubectl create -f "${pod_config_dir}/volume-claim.yaml"
3941

4042
# Check the persistent volume claim
41-
sudo -E kubectl get pvc $volume_claim | grep Bound
43+
cmd="sudo -E kubectl get pvc $volume_claim | grep Bound"
44+
waitForProcess "$wait_time" "$sleep_time" "$cmd"
4245

4346
# Create pod
4447
sudo -E kubectl create -f "${pod_config_dir}/pv-pod.yaml"

0 commit comments

Comments
 (0)