Skip to content

Commit

Permalink
ci: added timeout instead of sleep commands
Browse files Browse the repository at this point in the history
Instead of random sleep time, added timeout
so we will wait till the pods get started

Closes: rook#42
Signed-off-by: parth-gr <paarora@redhat.com>
  • Loading branch information
parth-gr committed Oct 20, 2022
1 parent 973a629 commit 2fa0110
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci-for-default-ns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ jobs:
# for testing start-debug and stop-debug deployment
# mons
kubectl rook_ceph debug start rook-ceph-mon-a
sleep 5
tkubectl-rook-ceph.sh wait_for_deployment_to_be_running rook-ceph-mon-a-debug rook-ceph
kubectl rook_ceph debug stop rook-ceph-mon-a
# osd
kubectl rook_ceph debug start rook-ceph-osd-0
sleep 5
kubectl-rook-ceph.sh wait_for_deployment_to_be_running rook-ceph-osd-0-debug rook-ceph
kubectl rook_ceph debug stop rook-ceph-osd-0
# sleep again so OSD can start
sleep 5
# check if osd 0 is started
kubectl-rook-ceph.sh wait_for_deployment_to_be_running rook-ceph-osd-0 rook-ceph
# for testing osd purge scale the osd deplyment
kubectl --namespace rook-ceph scale deploy/rook-ceph-osd-0 --replicas=0
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/ci-for-diff-ns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,38 @@ jobs:
tests/github-action-helper.sh wait_for_three_mons test-cluster
kubectl -n test-cluster wait deployment rook-ceph-mon-d --for condition=Available=True --timeout=90s
kubectl -n test-cluster wait deployment rook-ceph-mon-e --for condition=Available=True --timeout=90s
<<<<<<< HEAD

# for testing osd purge scale the osd deplyment
kubectl --namespace test-cluster scale deploy/rook-ceph-osd-0 --replicas=0
# we need to sleep so the osd will be marked down before purging the osd
sleep 5
kubectl-rook_ceph -o test-operator -n test-cluster rook purge-osd 0 --force
kubectl rook_ceph -o test-operator -n test-cluster health
=======
>>>>>>> 3007d8d (ci: added timeout instead of sleep commands)

# for testing start-debug and stop-debug deployment
# mon
kubectl rook_ceph -o test-operator -n test-cluster debug start rook-ceph-mon-a
# sleep till the debug pod get running
sleep 5
kubectl-rook-ceph.sh wait_for_deployment_to_be_running rook-ceph-mon-a-debug test-cluster
kubectl rook_ceph -o test-operator -n test-cluster debug stop rook-ceph-mon-a
# osd
kubectl rook_ceph -o test-operator -n test-cluster debug start rook-ceph-osd-0
# sleep till the debug pod get running
sleep 5
kubectl-rook-ceph.sh wait_for_deployment_to_be_running rook-ceph-osd-0-debug test-cluster
kubectl rook_ceph -o test-operator -n test-cluster debug stop rook-ceph-osd-0

# check if osd 0 is started
kubectl-rook-ceph.sh wait_for_deployment_to_be_running rook-ceph-osd-0 test-cluster

# for testing osd purge scale the osd deplyment
kubectl --namespace test-cluster scale deploy/rook-ceph-osd-0 --replicas=0
# we need to sleep so the osd will be marked down before purging the osd
sleep 5
kubectl-rook_ceph -o test-operator -n test-cluster rook purge-osd 0 --force
kubectl rook_ceph -o test-operator -n test-cluster health


- name: setup tmate session for debugging when event is PR
if: failure() && github.event_name == 'pull_request'
uses: mxschmitt/action-tmate@v3
Expand Down

0 comments on commit 2fa0110

Please sign in to comment.