Skip to content

Commit

Permalink
Update tests/e2e/crud/crud_test.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Yusuke Kato <[email protected]>
  • Loading branch information
kpango and coderabbitai[bot] authored Nov 11, 2024
1 parent c8b5613 commit abe93d0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/e2e/crud/crud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -807,13 +807,23 @@ func TestE2EIndexJobCorrection(t *testing.T) {
if err != nil {
t.Fatalf("an error occurred: %s", err)
}
if len(detail.Counts) == 0 {
t.Fatal("no pods found with index details")
}
var target string
for a, c := range detail.Counts {
if c.Stored > 0 {
target = strings.Split(a, ":")[0]
parts := strings.Split(a, ":")
if len(parts) == 0 {
t.Fatalf("invalid address format: %s", a)
}
target = parts[0]
break
}
}
if target == "" {
t.Fatal("no pods found with stored count > 0")
}

cmd := exec.CommandContext(ctx, "sh", "-c", fmt.Sprintf("kubectl get pods -o custom-columns=:metadata.name --no-headers=true --field-selector=\"status.podIP=%s\"", target))
out, err := cmd.Output()
Expand Down

0 comments on commit abe93d0

Please sign in to comment.