NET-2285: Assert total number of expected instances by Consul (#16371)

This commit is contained in:
Anita Akaeze 2023-02-22 15:43:20 -05:00 committed by GitHub
parent f0b2b16ef6
commit 518974934f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -58,6 +58,7 @@ func TestTrafficManagement_ServiceResolverDefaultSubset(t *testing.T) {
buildOpts.InjectAutoEncryption = false
}
cluster, _, _ := topology.NewPeeringCluster(t, 1, buildOpts)
node := cluster.Agents[0]
// Register service resolver
serviceResolver := &api.ServiceResolverConfigEntry{
@ -127,6 +128,9 @@ func TestTrafficManagement_ServiceResolverDefaultSubset(t *testing.T) {
libassert.AssertEnvoyPresentsCertURI(t, serverAdminPortV1, "static-server")
libassert.AssertEnvoyPresentsCertURI(t, serverAdminPortV2, "static-server")
// assert static-server proxies should be healthy
libassert.AssertServiceHasHealthyInstances(t, node, libservice.StaticServerServiceName, true, 3)
// static-client upstream should connect to static-server-v2 because the default subset value is to v2 set in the service resolver
libassert.AssertFortioName(t, fmt.Sprintf("http://localhost:%d", port), "static-server-v2")
}