Skip to content

Commit

Permalink
Merge pull request #1197 from spidernet-io/bz/fix/e2e/R00008/egp-not-…
Browse files Browse the repository at this point in the history
…found

fix time out to wait egressgateway status to be empty after delete the polices
  • Loading branch information
weizhoublue authored Feb 22, 2024
2 parents 14aaeaf + 4f0c0fb commit da02473
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/e2e/reliability/reliability_ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
. "github.com/onsi/gomega"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"

egressv1 "github.com/spidernet-io/egressgateway/pkg/k8s/apis/v1beta1"
"github.com/spidernet-io/egressgateway/test/e2e/common"
Expand Down Expand Up @@ -137,11 +138,19 @@ var _ = Describe("IP Allocation", Label("Reliability_IP"), func() {

// check eip after policies deleted
By("check egressgateway status should be empty")
err = common.WaitEGWSyncedWithEGP(cli, egw, egressConfig.EnableIPv4, egressConfig.EnableIPv6, 0, deletionThresholdTime)
Expect(err).NotTo(HaveOccurred())
Eventually(ctx, func() []egressv1.Eips {
eips := make([]egressv1.Eips, 0)
_ = cli.Get(ctx, types.NamespacedName{Namespace: egw.Namespace, Name: egw.Name}, egw)
for _, eipStatus := range egw.Status.NodeList {
eips = append(eips, eipStatus.Eips...)
}
return eips
}).WithTimeout(time.Minute*2).WithPolling(time.Second*2).Should(BeEmpty(),
fmt.Sprintf("failed to wait the egressgateway: %s status to be empty, egressgateway yaml: %v", egw.Name, egw))
deletionTime := time.Since(deletionStart)

// check egessgateway ip number
By("check egressgateway status IPUsage")
if egressConfig.EnableIPv4 {
Expect(egw.Status.IPUsage.IPv4Free).To(Equal(int(IPNum)))
Expect(egw.Status.IPUsage.IPv4Total).To(Equal(int(IPNum)))
Expand Down

0 comments on commit da02473

Please sign in to comment.