Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E: make Graceful Restart test more resilient when restarting pods takes time #204

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/composite/collectlogs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
sudo chmod -R o+r /tmp/kind_logs

- name: Upload logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: /tmp/kind_logs/
5 changes: 4 additions & 1 deletion e2etests/pkg/k8s/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ package k8s

import (
"context"
"fmt"
"slices"
"time"

"errors"

"github.com/onsi/ginkgo/v2"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -54,7 +56,7 @@ func RestartFRRK8sPods(cs clientset.Interface) error {
}
}

return wait.PollUntilContextTimeout(context.Background(), time.Second,
return wait.PollUntilContextTimeout(context.Background(), 10*time.Second,
120*time.Second, false, func(context.Context) (bool, error) {
npods, err := FRRK8sPods(cs)
if err != nil {
Expand All @@ -68,6 +70,7 @@ func RestartFRRK8sPods(cs clientset.Interface) error {
return false, nil
}
if !podIsRunningAndReady(p) {
ginkgo.By(fmt.Sprintf("\t%v pod %s not ready", time.Now(), p.Name))
return false, nil
}
}
Expand Down
5 changes: 3 additions & 2 deletions e2etests/tests/graceful_restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ var _ = ginkgo.Describe("Establish BGP session with EnableGracefulRestart", func
close(c)
}()

Consistently(check, 1*time.Minute, time.Second).ShouldNot(HaveOccurred())
Eventually(c).Should(BeClosed())
// 2*time.Minute is important because that is the Graceful Restart timer.
Consistently(check, 2*time.Minute, time.Second).ShouldNot(HaveOccurred())
Eventually(c, time.Minute, time.Second).Should(BeClosed(), "restart FRRK8s pods are not yet ready")
},
ginkgo.Entry("IPV4", ipfamily.IPv4, "192.168.2.0/24"),
ginkgo.Entry("IPV6", ipfamily.IPv6, "fc00:f853:ccd:e799::/64"),
Expand Down
Loading