Skip to content

Commit 11f98e3

Browse files
authored
Update health_check_test.go (#5023)
Signed-off-by: icys <2443138363@qq.com>
1 parent a608fdc commit 11f98e3

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

pkg/ddc/alluxio/health_check_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,22 @@ func TestCheckMasterHealthy(t *testing.T) {
369369
}
370370
}
371371

372+
// TestCheckWorkersHealthy validates the health check functionality for Alluxio runtime workers.
373+
// It covers three primary scenarios:
374+
// 1. Unhealthy workers (StatefulSet with readyReplicas < desired replicas)
375+
// 2. Healthy workers (StatefulSet with readyReplicas matching desired count)
376+
// 3. Deprecated worker types (DaemonSet-based workers that should remain unchanged)
377+
//
378+
// The test verifies:
379+
// - Correct error handling based on worker status
380+
// - Proper updates to RuntimeStatus fields (WorkerNumberReady/Available)
381+
// - Appropriate condition updates for worker readiness
382+
// - Idempotency for deprecated worker implementations
383+
//
384+
// Test cases include:
385+
// - Case 1: Workers not ready (0 ready replicas out of 2 desired)
386+
// - Case 2: Workers fully ready (1 ready replica matching desired count)
387+
// - Case 3: Deprecated worker type (no status changes expected)
372388
func TestCheckWorkersHealthy(t *testing.T) {
373389
var statefulSetInputs = []appsv1.StatefulSet{
374390
{

0 commit comments

Comments
 (0)