Skip to content

Commit

Permalink
Fix restart
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <[email protected]>
  • Loading branch information
wenqiq committed Mar 21, 2024
1 parent aa3ae52 commit 14946d3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
23 changes: 20 additions & 3 deletions test/performance/framework/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ func init() {

func ScaleRestartAgent(ctx context.Context, ch chan time.Duration, data *ScaleData) (res ScaleResult) {
var err error
defer func() {
res.err = err
}()
res.scaleNum = data.nodesNum

prober := fmt.Sprintf("%s:%d", "", antreaapis.AntreaAgentAPIPort)
Expand Down Expand Up @@ -93,6 +90,18 @@ func ScaleRestartAgent(ctx context.Context, ch chan time.Duration, data *ScaleDa
}
}()

defer func() {
res.err = err
for {
klog.InfoS("Waiting the check goroutine finish", "expectPodNum", expectPodNum, "len(ch)", len(ch))
if len(ch) == expectPodNum {
break
}
klog.InfoS("Waiting the check goroutine finish")
time.Sleep(time.Second)
}
}()

res.actualCheckNum = expectPodNum
return
}
Expand All @@ -102,6 +111,14 @@ func RestartController(ctx context.Context, ch chan time.Duration, data *ScaleDa
res.scaleNum = 1
defer func() {
res.err = err
for {
klog.InfoS("Waiting the check goroutine finish", "len(ch)", len(ch))
if len(ch) == 1 {
break
}
klog.InfoS("Waiting the check goroutine finish")
time.Sleep(time.Second)
}
}()

prober := fmt.Sprintf("%s:%d", "", antreaapis.AntreaControllerAPIPort)
Expand Down
1 change: 1 addition & 0 deletions test/performance/framework/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func ScaleService(ctx context.Context, ch chan time.Duration, data *ScaleData) (
defer func() {
res.err = err
for {
klog.InfoS("Waiting the check goroutine finish", "len(svcs)", len(svcs), "cap(svcs)", cap(svcs))
if len(ch) == len(svcs) {
break
}
Expand Down

0 comments on commit 14946d3

Please sign in to comment.