@@ -66,6 +66,7 @@ var _ = framework.Describe("[group:gc]", func() {
6666 })
6767
6868 ginkgo .It ("should gc stale ip_port_mappings in OVN LoadBalancer" , func () {
69+ ginkgo .Skip ("GC doesn't yet run periodically and can't be E2E tested" )
6970 ginkgo .By ("1. Creating a SwitchLBRule to populate LoadBalancer" )
7071 labels := map [string ]string {"app" : "gc-test" }
7172 annotations := map [string ]string {util .LogicalSwitchAnnotation : subnetName }
@@ -96,18 +97,21 @@ var _ = framework.Describe("[group:gc]", func() {
9697 framework .ExpectNotEmpty (lbName )
9798
9899 ginkgo .By ("Verifying active ip_port_mapping exists for backend " + backendIP )
99- cmd := []string {"ovn-nbctl" , "get" , "load_balancer" , lbName , "ip_port_mappings" }
100- stdout , _ , err := framework .NBExec (cmd ... )
101- framework .ExpectNil (err )
102- framework .ExpectContainSubstring (string (stdout ), backendIP )
100+ framework .WaitUntil (5 * time .Second , 2 * time .Minute , func (_ context.Context ) (bool , error ) {
101+ cmd := []string {"ovn-nbctl" , "get" , "load_balancer" , lbName , "ip_port_mappings" }
102+ stdout , _ , err := framework .NBExec (cmd ... )
103+ framework .ExpectNil (err )
104+
105+ return strings .Contains (string (stdout ), backendIP ), nil
106+ }, "we got correct ip_port_mappings" )
103107
104108 ginkgo .By ("3. Manually injecting a stale ip_port_mapping entry" )
105109 staleIP := "1.2.3.4"
106110 staleMapping := "stale-node"
107111
108112 // Get existing mappings to ensure we don't overwrite them
109- cmd = []string {"ovn-nbctl" , "get" , "load_balancer" , lbName , "ip_port_mappings" }
110- stdout , _ , err = framework .NBExec (cmd ... )
113+ cmd : = []string {"ovn-nbctl" , "get" , "load_balancer" , lbName , "ip_port_mappings" }
114+ stdout , _ , err : = framework .NBExec (cmd ... )
111115 framework .ExpectNil (err )
112116 existingMappings := strings .TrimSpace (string (stdout ))
113117
@@ -129,9 +133,9 @@ var _ = framework.Describe("[group:gc]", func() {
129133 }
130134
131135 ginkgo .By ("4. Waiting for GC to clean up the stale entry" )
132- // The default GC interval might be long, but in E2E tests we expect the controller to be running .
133- // If GC interval is e.g. 60s, we might need to wait.
134- framework .WaitUntil (5 * time .Second , 2 * time .Minute , func (_ context.Context ) (bool , error ) {
136+ // Currently, the GC doesn't run periodically for this type of stuff.. .
137+ // This test can be used to test the GC by end, but not yet in E2E testing
138+ framework .WaitUntil (5 * time .Second , 1 * time .Minute , func (_ context.Context ) (bool , error ) {
135139 stdout , _ , err = framework .NBExec (cmd ... )
136140 if err != nil {
137141 return false , err
0 commit comments