Skip to content

Commit

Permalink
test(lb): loosen up assertion lb weights (backport of #11720) (#11721)
Browse files Browse the repository at this point in the history
* test(lb): loosen up assertion lb weights (#11720)

Signed-off-by: slonka <slonka@users.noreply.github.com>

---------

Signed-off-by: slonka <slonka@users.noreply.github.com>
Signed-off-by: Marcin Skalski <skalskimarcin33@gmail.com>
Co-authored-by: Krzysztof Słonka <slonka@users.noreply.github.com>
Co-authored-by: Marcin Skalski <skalskimarcin33@gmail.com>
  • Loading branch information
3 people authored Oct 9, 2024
1 parent 9e2c565 commit b9b5d5d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ spec:
Eventually(func() (map[string]int, error) {
return client.CollectResponsesByInstance(multizone.UniZone1, "demo-client_locality-aware-lb-egress_svc", "test-server_locality-aware-lb-egress_svc_80.mesh", client.WithNumberOfRequests(50))
}, "1m", "10s").Should(
HaveKeyWithValue(Equal(`test-server-zone-4`), BeNumerically("~", 50, 10)),
HaveKeyWithValue(Equal(`test-server-zone-4`), BeNumerically("~", 50, 25)),
)

// kill test-server in kuma-4 zone
Expand All @@ -175,7 +175,7 @@ spec:
Eventually(func() (map[string]int, error) {
return client.CollectResponsesByInstance(multizone.UniZone1, "demo-client_locality-aware-lb-egress_svc", "test-server_locality-aware-lb-egress_svc_80.mesh", client.WithNumberOfRequests(50))
}, "1m", "10s").Should(
HaveKeyWithValue(Equal(`test-server-zone-1`), BeNumerically("~", 50, 10)),
HaveKeyWithValue(Equal(`test-server-zone-1`), BeNumerically("~", 50, 25)),
)

// apply lb policy with new priorities
Expand All @@ -197,7 +197,7 @@ spec:
Eventually(func() (map[string]int, error) {
return client.CollectResponsesByInstance(multizone.UniZone1, "demo-client_locality-aware-lb-egress_svc", "test-server_locality-aware-lb-egress_svc_80.mesh", client.WithNumberOfRequests(50))
}, "1m", "10s").Should(
HaveKeyWithValue(Equal(`test-server-zone-5`), BeNumerically("~", 50, 10)),
HaveKeyWithValue(Equal(`test-server-zone-5`), BeNumerically("~", 50, 25)),
)

// kill test-server from kuma-5 zone
Expand All @@ -207,7 +207,7 @@ spec:
Eventually(func() (map[string]int, error) {
return client.CollectResponsesByInstance(multizone.UniZone1, "demo-client_locality-aware-lb-egress_svc", "test-server_locality-aware-lb-egress_svc_80.mesh", client.WithNumberOfRequests(50))
}, "1m", "10s").Should(
HaveKeyWithValue(Equal(`test-server-zone-1`), BeNumerically("~", 50, 10)),
HaveKeyWithValue(Equal(`test-server-zone-1`), BeNumerically("~", 50, 25)),
)
})
}

0 comments on commit b9b5d5d

Please sign in to comment.