Skip to content

Commit

Permalink
[RayService] Use waitGroup to ensure goroutine completion in rayservi…
Browse files Browse the repository at this point in the history
…ce_ha_test (#2657)

Signed-off-by: win5923 <[email protected]>
  • Loading branch information
win5923 authored Dec 16, 2024
1 parent 61a282f commit 9be883f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ray-operator/test/e2e/rayservice_ha_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package e2e

import (
"sync"
"testing"
"time"

Expand Down Expand Up @@ -173,7 +174,12 @@ func TestRayServiceZeroDowntimeUpgrade(t *testing.T) {
ExecPodCmd(test, headPod, common.RayHeadContainer, []string{"pip", "install", "locust"})

// Start a goroutine to perform zero-downtime upgrade
var wg sync.WaitGroup
wg.Add(1)

go func() {
defer wg.Done()

test.T().Logf("Waiting several seconds before updating RayService")
time.Sleep(30 * time.Second)

Expand All @@ -196,4 +202,6 @@ func TestRayServiceZeroDowntimeUpgrade(t *testing.T) {
ExecPodCmd(test, headPod, common.RayHeadContainer, []string{
"python", "/locust-runner/locust_runner.py", "-f", "/locustfile/locustfile.py", "--host", "http://test-rayservice-serve-svc:8000",
})

wg.Wait()
}

0 comments on commit 9be883f

Please sign in to comment.