@@ -6,14 +6,17 @@ setup() {
66 _common_setup
77}
88
9-
109# Currently, the tests defined in this file deliberately depend on each other
1110# and are expected to execute in the order defined. In the future, we want to
1211# build test dependency injection (with fixtures), and work towards clean
1312# _isolation_ between tests. To that end, we will hopefully find fast and
1413# reliable strategies to conceptually prevent cross-contamination from
1514# happening. Tools like `etcdctl` will be helpful.
1615
16+ # Hint: when developing/testing a specific test, for faster iteration add the
17+ # comment `# bats test_tags=bats:focus` on top of the current test. This can
18+ # help (requires the test to be self-contained though, i.e. it sets up its
19+ # dependencies' does not rely on a previous test for that).
1720
1821# Note(JP): bats swallows output of setup upon success (regardless of cmdline
1922# args such as `--show-output-of-passing-tests`). Ref:
@@ -59,6 +62,7 @@ log_objects() {
5962 kubectl get resourceclaims || true
6063 kubectl get computedomain || true
6164 kubectl get pods -o wide || true
65+ kubectl get pods -o wide -n nvidia-dra-driver-gpu || true
6266}
6367
6468# A test that covers local dev tooling, we don't want to
@@ -370,14 +374,17 @@ log_objects() {
370374 # Reconfigure (only the) log verbosity for CD daemons spawned in the future.
371375 # The deployment mutation via `set env` below is expected to restart the
372376 # controller. Wait for the old controller pod to go away (to be sure that the
373- # new LOG_VERBOSITY_CD_DAEMON setting applies).
374- CPOD=" $( get_current_controller_pod_name) "
377+ # new LOG_VERBOSITY_CD_DAEMON setting applies), and make sure controller
378+ # deployment is still READY before moving on (make sure 1/1 READY).
379+ CPOD_OLD=" $( get_current_controller_pod_name) "
375380 log_objects
376381 kubectl set env deployment nvidia-dra-driver-gpu-controller -n nvidia-dra-driver-gpu LOG_VERBOSITY_CD_DAEMON=0
377- echo " waiting for pod $CPOD "
378- kubectl wait --for=delete pods " $CPOD " -n nvidia-dra-driver-gpu --timeout=10s
379- echo " done waiting"
380- log_objects
382+ echo " wait --for=delete: $CPOD_OLD "
383+ kubectl wait --for=delete pods " $CPOD_OLD " -n nvidia-dra-driver-gpu --timeout=10s
384+ echo " returned: wait --for=delete"
385+ CPOD_NEW=" $( get_current_controller_pod_name) "
386+ kubectl wait --for=condition=READY pods " $CPOD_NEW " -n nvidia-dra-driver-gpu --timeout=10s
387+ echo " new controller pod is in effect"
381388
382389 # Spawn new workload
383390 kubectl apply -f demo/specs/imex/channel-injection.yaml
0 commit comments