You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix scale-out test to use ReadWriteMany
The scale-out test requires multiple pods to share the same PVC,
which necessitates ReadWriteMany access mode instead of ReadWriteOnce.
This change updates the PVC configuration and adds intelligent detection
to skip the test gracefully when ReadWriteMany is not supported by the storage class.
Changes:
- Update PVC access mode from ReadWriteOnce to ReadWriteMany in scale-out test configurations
- Add logic to detect when ReadWriteMany is unsupported by checking PVC status and events
- Skip test with clear SKIP message in logs when ReadWriteMany is unavailable
- Ensure cleanup occurs regardless of skip status
Signed-off-by: Sergio Arroutbi <[email protected]>
* Improve scalability test robustness and cleanup
This commit enhances the scale-out test with better PVC readiness detection,
proper resource cleanup ordering, and code refactoring:
- Add waitForPvcPhase() helper with retry loop for PVC status checking
- Add checkPodsAndServices() helper to reduce code duplication
- Introduce TO_PVC_READY timeout constant (30s)
- Track scale_out1 creation state to ensure proper cleanup
- Fix cleanup order: delete scale_out1 before scale_out0
- Replace repetitive pod/service checks with helper function calls
These changes address issues with PVC binding detection and ensure
resources are cleaned up in the correct order, preventing test failures
in environments with varying storage provisioner speeds.
Co-Authored-By: Claude <[email protected]>
Signed-off-by: Sergio Arroutbi <[email protected]>
---------
Signed-off-by: Sergio Arroutbi <[email protected]>
Co-authored-by: Claude <[email protected]>
rlAssertNotEquals "Checking pod name not empty""${pod2_name}"""
49
-
rlRun "ocpopCheckPodState Running ${TO_POD_START}${TEST_NAMESPACE}${pod2_name}" 0 "Checking added POD in Running state [Timeout=${TO_POD_START} secs.]"
50
-
rlRun "${OC_CLIENT} delete -f ${TANG_FUNCTION_DIR}/reg_test/scale_test/scale_out/scale_out0/" 0 "Deleting scale out test"
# Check if the issue is due to ReadWriteMany not being supported
86
+
pvc_events=$(${OC_CLIENT} get events -n ${TEST_NAMESPACE} --field-selector involvedObject.name=tangserver-pvc -o json 2>/dev/null)
87
+
ifecho"$pvc_events"| grep -q -i "storageclass.*does not support.*ReadWriteMany\|no.*volume.*plugin.*matched\|volume.*does not support.*access mode";then
88
+
rlLogWarning "ReadWriteMany access mode is not supported by the storage class. Skipping scale-out test."
89
+
rlLog "RESULT: SKIP - ReadWriteMany not supported"
90
+
SKIP_TEST=1
91
+
fi
92
+
fi
93
+
94
+
if [ $SKIP_TEST-eq 0 ];then
95
+
# Continue with normal test if PVC is bound or accessible
rlAssertNotEquals "Checking pod name not empty""${pod2_name}"""
105
+
rlRun "ocpopCheckPodState Running ${TO_POD_START}${TEST_NAMESPACE}${pod2_name}" 0 "Checking added POD in Running state [Timeout=${TO_POD_START} secs.]"
106
+
fi
107
+
108
+
# Cleanup regardless of skip status
109
+
if [ $SCALE_OUT1_CREATED-eq 1 ];then
110
+
rlRun "${OC_CLIENT} delete -f ${TANG_FUNCTION_DIR}/reg_test/scale_test/scale_out/scale_out1/" 0 "Deleting scale out test [1]"
111
+
fi
112
+
rlRun "${OC_CLIENT} delete -f ${TANG_FUNCTION_DIR}/reg_test/scale_test/scale_out/scale_out0/ --ignore-not-found=true" 0 "Deleting scale out test [0]"
rlAssertNotEquals "Checking pod name not empty""${pod1_name}"""
@@ -68,14 +128,12 @@ rlJournalStart
68
128
rlAssertNotEquals "Checking pod name not empty""${pod1_name}"""
69
129
rlRun "ocpopCheckPodState Running ${TO_POD_START}${TEST_NAMESPACE}${pod1_name}" 0 "Checking POD:[$pod1_name}] still in Running state [Timeout=${TO_POD_START} secs.]"
70
130
rlRun "${OC_CLIENT} delete -f ${TANG_FUNCTION_DIR}/reg_test/scale_test/scale_in/scale_in0/" 0 "Deleting scale in test"
0 commit comments