mirror of https://github.com/grpc/grpc-java.git
Revert "Fix RLS regressions from XdsDepMan conversion"
This reverts commitf6ba7c5291
as part of reverting297ab05efe
.
This commit is contained in:
parent
f6ba7c5291
commit
f951487ccf
|
@ -255,13 +255,6 @@ final class CachingRlsLbClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status acceptResolvedAddressFactory(ResolvedAddressFactory childLbResolvedAddressFactory) {
|
|
||||||
synchronized (lock) {
|
|
||||||
return refCountedChildPolicyWrapperFactory.acceptResolvedAddressFactory(
|
|
||||||
childLbResolvedAddressFactory);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert the status to UNAVAILABLE and enhance the error message.
|
* Convert the status to UNAVAILABLE and enhance the error message.
|
||||||
* @param status status as provided by server
|
* @param status status as provided by server
|
||||||
|
|
|
@ -31,7 +31,6 @@ import io.grpc.LoadBalancer.SubchannelPicker;
|
||||||
import io.grpc.LoadBalancerProvider;
|
import io.grpc.LoadBalancerProvider;
|
||||||
import io.grpc.LoadBalancerRegistry;
|
import io.grpc.LoadBalancerRegistry;
|
||||||
import io.grpc.NameResolver.ConfigOrError;
|
import io.grpc.NameResolver.ConfigOrError;
|
||||||
import io.grpc.Status;
|
|
||||||
import io.grpc.internal.ObjectPool;
|
import io.grpc.internal.ObjectPool;
|
||||||
import io.grpc.rls.ChildLoadBalancerHelper.ChildLoadBalancerHelperProvider;
|
import io.grpc.rls.ChildLoadBalancerHelper.ChildLoadBalancerHelperProvider;
|
||||||
import io.grpc.rls.RlsProtoData.RouteLookupConfig;
|
import io.grpc.rls.RlsProtoData.RouteLookupConfig;
|
||||||
|
@ -212,7 +211,7 @@ final class LbPolicyConfiguration {
|
||||||
private final ChildLoadBalancerHelperProvider childLbHelperProvider;
|
private final ChildLoadBalancerHelperProvider childLbHelperProvider;
|
||||||
private final ChildLbStatusListener childLbStatusListener;
|
private final ChildLbStatusListener childLbStatusListener;
|
||||||
private final ChildLoadBalancingPolicy childPolicy;
|
private final ChildLoadBalancingPolicy childPolicy;
|
||||||
private ResolvedAddressFactory childLbResolvedAddressFactory;
|
private final ResolvedAddressFactory childLbResolvedAddressFactory;
|
||||||
|
|
||||||
public RefCountedChildPolicyWrapperFactory(
|
public RefCountedChildPolicyWrapperFactory(
|
||||||
ChildLoadBalancingPolicy childPolicy,
|
ChildLoadBalancingPolicy childPolicy,
|
||||||
|
@ -230,19 +229,6 @@ final class LbPolicyConfiguration {
|
||||||
childLbHelperProvider.init();
|
childLbHelperProvider.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
Status acceptResolvedAddressFactory(ResolvedAddressFactory childLbResolvedAddressFactory) {
|
|
||||||
this.childLbResolvedAddressFactory = childLbResolvedAddressFactory;
|
|
||||||
Status status = Status.OK;
|
|
||||||
for (RefCountedChildPolicyWrapper wrapper : childPolicyMap.values()) {
|
|
||||||
Status newStatus =
|
|
||||||
wrapper.childPolicyWrapper.acceptResolvedAddressFactory(childLbResolvedAddressFactory);
|
|
||||||
if (!newStatus.isOk()) {
|
|
||||||
status = newStatus;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
ChildPolicyWrapper createOrGet(String target) {
|
ChildPolicyWrapper createOrGet(String target) {
|
||||||
// TODO(creamsoup) check if the target is valid or not
|
// TODO(creamsoup) check if the target is valid or not
|
||||||
RefCountedChildPolicyWrapper pooledChildPolicyWrapper = childPolicyMap.get(target);
|
RefCountedChildPolicyWrapper pooledChildPolicyWrapper = childPolicyMap.get(target);
|
||||||
|
@ -291,7 +277,6 @@ final class LbPolicyConfiguration {
|
||||||
private final String target;
|
private final String target;
|
||||||
private final ChildPolicyReportingHelper helper;
|
private final ChildPolicyReportingHelper helper;
|
||||||
private final LoadBalancer lb;
|
private final LoadBalancer lb;
|
||||||
private final Object childLbConfig;
|
|
||||||
private volatile SubchannelPicker picker;
|
private volatile SubchannelPicker picker;
|
||||||
private ConnectivityState state;
|
private ConnectivityState state;
|
||||||
|
|
||||||
|
@ -310,14 +295,14 @@ final class LbPolicyConfiguration {
|
||||||
.parseLoadBalancingPolicyConfig(
|
.parseLoadBalancingPolicyConfig(
|
||||||
childPolicy.getEffectiveChildPolicy(target));
|
childPolicy.getEffectiveChildPolicy(target));
|
||||||
this.lb = lbProvider.newLoadBalancer(helper);
|
this.lb = lbProvider.newLoadBalancer(helper);
|
||||||
this.childLbConfig = lbConfig.getConfig();
|
|
||||||
helper.getChannelLogger().log(
|
helper.getChannelLogger().log(
|
||||||
ChannelLogLevel.DEBUG, "RLS child lb created. config: {0}", childLbConfig);
|
ChannelLogLevel.DEBUG, "RLS child lb created. config: {0}", lbConfig.getConfig());
|
||||||
helper.getSynchronizationContext().execute(
|
helper.getSynchronizationContext().execute(
|
||||||
new Runnable() {
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!acceptResolvedAddressFactory(childLbResolvedAddressFactory).isOk()) {
|
if (!lb.acceptResolvedAddresses(
|
||||||
|
childLbResolvedAddressFactory.create(lbConfig.getConfig())).isOk()) {
|
||||||
helper.refreshNameResolution();
|
helper.refreshNameResolution();
|
||||||
}
|
}
|
||||||
lb.requestConnection();
|
lb.requestConnection();
|
||||||
|
@ -325,11 +310,6 @@ final class LbPolicyConfiguration {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Status acceptResolvedAddressFactory(ResolvedAddressFactory childLbResolvedAddressFactory) {
|
|
||||||
helper.getSynchronizationContext().throwIfNotInThisSynchronizationContext();
|
|
||||||
return lb.acceptResolvedAddresses(childLbResolvedAddressFactory.create(childLbConfig));
|
|
||||||
}
|
|
||||||
|
|
||||||
String getTarget() {
|
String getTarget() {
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,9 +79,7 @@ final class RlsLoadBalancer extends LoadBalancer {
|
||||||
// not required.
|
// not required.
|
||||||
this.lbPolicyConfiguration = lbPolicyConfiguration;
|
this.lbPolicyConfiguration = lbPolicyConfiguration;
|
||||||
}
|
}
|
||||||
return routeLookupClient.acceptResolvedAddressFactory(
|
return Status.OK;
|
||||||
new ChildLbResolvedAddressFactory(
|
|
||||||
resolvedAddresses.getAddresses(), resolvedAddresses.getAttributes()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -823,9 +823,6 @@ final class XdsNameResolver extends NameResolver {
|
||||||
if (shouldUpdateResult && routingConfig != null) {
|
if (shouldUpdateResult && routingConfig != null) {
|
||||||
updateResolutionResult(xdsConfig);
|
updateResolutionResult(xdsConfig);
|
||||||
shouldUpdateResult = false;
|
shouldUpdateResult = false;
|
||||||
} else {
|
|
||||||
// Need to update at least once
|
|
||||||
shouldUpdateResult = true;
|
|
||||||
}
|
}
|
||||||
// Make newly added clusters selectable by config selector and deleted clusters no longer
|
// Make newly added clusters selectable by config selector and deleted clusters no longer
|
||||||
// selectable.
|
// selectable.
|
||||||
|
@ -996,8 +993,7 @@ final class XdsNameResolver extends NameResolver {
|
||||||
.put("routeLookupConfig", rlsPluginConfig.config())
|
.put("routeLookupConfig", rlsPluginConfig.config())
|
||||||
.put(
|
.put(
|
||||||
"childPolicy",
|
"childPolicy",
|
||||||
ImmutableList.of(ImmutableMap.of(XdsLbPolicies.CDS_POLICY_NAME, ImmutableMap.of(
|
ImmutableList.of(ImmutableMap.of(XdsLbPolicies.CDS_POLICY_NAME, ImmutableMap.of())))
|
||||||
"is_dynamic", true))))
|
|
||||||
.put("childPolicyConfigTargetFieldName", "cluster")
|
.put("childPolicyConfigTargetFieldName", "cluster")
|
||||||
.buildOrThrow();
|
.buildOrThrow();
|
||||||
return ImmutableMap.of("rls_experimental", rlsConfig);
|
return ImmutableMap.of("rls_experimental", rlsConfig);
|
||||||
|
|
|
@ -28,7 +28,6 @@ import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.ArgumentMatchers.anyInt;
|
import static org.mockito.ArgumentMatchers.anyInt;
|
||||||
import static org.mockito.ArgumentMatchers.anyLong;
|
import static org.mockito.ArgumentMatchers.anyLong;
|
||||||
import static org.mockito.ArgumentMatchers.eq;
|
import static org.mockito.ArgumentMatchers.eq;
|
||||||
import static org.mockito.Mockito.atLeast;
|
|
||||||
import static org.mockito.Mockito.lenient;
|
import static org.mockito.Mockito.lenient;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.never;
|
import static org.mockito.Mockito.never;
|
||||||
|
@ -450,7 +449,7 @@ public class XdsNameResolverTest {
|
||||||
// Two new service config updates triggered:
|
// Two new service config updates triggered:
|
||||||
// - with load balancing config being able to select cluster1 and cluster2
|
// - with load balancing config being able to select cluster1 and cluster2
|
||||||
// - with load balancing config being able to select cluster2 only
|
// - with load balancing config being able to select cluster2 only
|
||||||
verify(mockListener, times(3)).onResult2(resultCaptor.capture());
|
verify(mockListener, times(2)).onResult2(resultCaptor.capture());
|
||||||
assertServiceConfigForLoadBalancingConfig(
|
assertServiceConfigForLoadBalancingConfig(
|
||||||
Arrays.asList(cluster1, cluster2),
|
Arrays.asList(cluster1, cluster2),
|
||||||
(Map<String, ?>) resultCaptor.getAllValues().get(0).getServiceConfig().getConfig());
|
(Map<String, ?>) resultCaptor.getAllValues().get(0).getServiceConfig().getConfig());
|
||||||
|
@ -1071,9 +1070,7 @@ public class XdsNameResolverTest {
|
||||||
assertCallSelectClusterResult(call1, configSelector, "another-cluster", 20.0);
|
assertCallSelectClusterResult(call1, configSelector, "another-cluster", 20.0);
|
||||||
|
|
||||||
firstCall.deliverErrorStatus(); // completes previous call
|
firstCall.deliverErrorStatus(); // completes previous call
|
||||||
// Two updates: one for XdsNameResolver releasing the cluster, and another for
|
verify(mockListener, times(2)).onResult2(resolutionResultCaptor.capture());
|
||||||
// XdsDependencyManager updating the XdsConfig
|
|
||||||
verify(mockListener, times(3)).onResult2(resolutionResultCaptor.capture());
|
|
||||||
result = resolutionResultCaptor.getValue();
|
result = resolutionResultCaptor.getValue();
|
||||||
assertServiceConfigForLoadBalancingConfig(
|
assertServiceConfigForLoadBalancingConfig(
|
||||||
Arrays.asList(cluster2, "another-cluster"),
|
Arrays.asList(cluster2, "another-cluster"),
|
||||||
|
@ -1103,7 +1100,7 @@ public class XdsNameResolverTest {
|
||||||
ImmutableMap.of())));
|
ImmutableMap.of())));
|
||||||
// Two consecutive service config updates: one for removing clcuster1,
|
// Two consecutive service config updates: one for removing clcuster1,
|
||||||
// one for adding "another=cluster".
|
// one for adding "another=cluster".
|
||||||
verify(mockListener, times(3)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener, times(2)).onResult2(resolutionResultCaptor.capture());
|
||||||
ResolutionResult result = resolutionResultCaptor.getValue();
|
ResolutionResult result = resolutionResultCaptor.getValue();
|
||||||
assertServiceConfigForLoadBalancingConfig(
|
assertServiceConfigForLoadBalancingConfig(
|
||||||
Arrays.asList(cluster2, "another-cluster"),
|
Arrays.asList(cluster2, "another-cluster"),
|
||||||
|
@ -1158,7 +1155,7 @@ public class XdsNameResolverTest {
|
||||||
cluster2, Collections.emptyList(),
|
cluster2, Collections.emptyList(),
|
||||||
TimeUnit.SECONDS.toNanos(15L), null, false),
|
TimeUnit.SECONDS.toNanos(15L), null, false),
|
||||||
ImmutableMap.of())));
|
ImmutableMap.of())));
|
||||||
verify(mockListener, times(2)).onResult2(resolutionResultCaptor.capture());
|
verifyNoMoreInteractions(mockListener); // no cluster added/deleted
|
||||||
assertCallSelectClusterResult(call1, configSelector, "another-cluster", 15.0);
|
assertCallSelectClusterResult(call1, configSelector, "another-cluster", 15.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1190,13 +1187,7 @@ public class XdsNameResolverTest {
|
||||||
null, false),
|
null, false),
|
||||||
ImmutableMap.of())));
|
ImmutableMap.of())));
|
||||||
testCall.deliverErrorStatus();
|
testCall.deliverErrorStatus();
|
||||||
verify(mockListener, times(3)).onResult2(resolutionResultCaptor.capture());
|
verifyNoMoreInteractions(mockListener);
|
||||||
assertServiceConfigForLoadBalancingConfig(
|
|
||||||
Arrays.asList(cluster1, cluster2), resolutionResultCaptor.getAllValues().get(1));
|
|
||||||
assertServiceConfigForLoadBalancingConfig(
|
|
||||||
Arrays.asList(cluster1, cluster2), resolutionResultCaptor.getAllValues().get(2));
|
|
||||||
assertServiceConfigForLoadBalancingConfig(
|
|
||||||
Arrays.asList(cluster1, cluster2), resolutionResultCaptor.getAllValues().get(3));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -1277,7 +1268,7 @@ public class XdsNameResolverTest {
|
||||||
"routeLookupConfig",
|
"routeLookupConfig",
|
||||||
ImmutableMap.of("lookupService", "rls-cbt.googleapis.com"),
|
ImmutableMap.of("lookupService", "rls-cbt.googleapis.com"),
|
||||||
"childPolicy",
|
"childPolicy",
|
||||||
ImmutableList.of(ImmutableMap.of("cds_experimental", ImmutableMap.of("is_dynamic", true))),
|
ImmutableList.of(ImmutableMap.of("cds_experimental", ImmutableMap.of())),
|
||||||
"childPolicyConfigTargetFieldName",
|
"childPolicyConfigTargetFieldName",
|
||||||
"cluster");
|
"cluster");
|
||||||
Map<String, ?> expectedClusterManagerLbConfig = ImmutableMap.of(
|
Map<String, ?> expectedClusterManagerLbConfig = ImmutableMap.of(
|
||||||
|
@ -1324,7 +1315,7 @@ public class XdsNameResolverTest {
|
||||||
"routeLookupConfig",
|
"routeLookupConfig",
|
||||||
ImmutableMap.of("lookupService", "rls-cbt-2.googleapis.com"),
|
ImmutableMap.of("lookupService", "rls-cbt-2.googleapis.com"),
|
||||||
"childPolicy",
|
"childPolicy",
|
||||||
ImmutableList.of(ImmutableMap.of("cds_experimental", ImmutableMap.of("is_dynamic", true))),
|
ImmutableList.of(ImmutableMap.of("cds_experimental", ImmutableMap.of())),
|
||||||
"childPolicyConfigTargetFieldName",
|
"childPolicyConfigTargetFieldName",
|
||||||
"cluster");
|
"cluster");
|
||||||
Map<String, ?> expectedClusterManagerLbConfig2 = ImmutableMap.of(
|
Map<String, ?> expectedClusterManagerLbConfig2 = ImmutableMap.of(
|
||||||
|
@ -1665,7 +1656,7 @@ public class XdsNameResolverTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertClusterResolutionResult(CallInfo call, String expectedCluster) {
|
private void assertClusterResolutionResult(CallInfo call, String expectedCluster) {
|
||||||
verify(mockListener, atLeast(1)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener).onResult2(resolutionResultCaptor.capture());
|
||||||
ResolutionResult result = resolutionResultCaptor.getValue();
|
ResolutionResult result = resolutionResultCaptor.getValue();
|
||||||
InternalConfigSelector configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
InternalConfigSelector configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
assertCallSelectClusterResult(call, configSelector, expectedCluster, null);
|
assertCallSelectClusterResult(call, configSelector, expectedCluster, null);
|
||||||
|
@ -1753,13 +1744,6 @@ public class XdsNameResolverTest {
|
||||||
return result.getAttributes().get(InternalConfigSelector.KEY);
|
return result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void assertServiceConfigForLoadBalancingConfig(
|
|
||||||
List<String> clusters, ResolutionResult result) {
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Map<String, ?> config = (Map<String, ?>) result.getServiceConfig().getConfig();
|
|
||||||
assertServiceConfigForLoadBalancingConfig(clusters, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies the raw service config contains an xDS load balancing config for the given clusters.
|
* Verifies the raw service config contains an xDS load balancing config for the given clusters.
|
||||||
*/
|
*/
|
||||||
|
@ -1863,9 +1847,7 @@ public class XdsNameResolverTest {
|
||||||
+ " \"lookupService\": \"rls.bigtable.google.com\"\n"
|
+ " \"lookupService\": \"rls.bigtable.google.com\"\n"
|
||||||
+ " },\n"
|
+ " },\n"
|
||||||
+ " \"childPolicy\": [\n"
|
+ " \"childPolicy\": [\n"
|
||||||
+ " {\"cds_experimental\": {\n"
|
+ " {\"cds_experimental\": {}}\n"
|
||||||
+ " \"is_dynamic\": true\n"
|
|
||||||
+ " }}\n"
|
|
||||||
+ " ],\n"
|
+ " ],\n"
|
||||||
+ " \"childPolicyConfigTargetFieldName\": \"cluster\"\n"
|
+ " \"childPolicyConfigTargetFieldName\": \"cluster\"\n"
|
||||||
+ " }\n"
|
+ " }\n"
|
||||||
|
@ -2053,7 +2035,7 @@ public class XdsNameResolverTest {
|
||||||
FaultAbort.forHeader(FaultConfig.FractionalPercent.perMillion(600_000)),
|
FaultAbort.forHeader(FaultConfig.FractionalPercent.perMillion(600_000)),
|
||||||
null);
|
null);
|
||||||
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
||||||
verify(mockListener, times(2)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener).onResult2(resolutionResultCaptor.capture());
|
||||||
result = resolutionResultCaptor.getValue();
|
result = resolutionResultCaptor.getValue();
|
||||||
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
||||||
|
@ -2069,7 +2051,7 @@ public class XdsNameResolverTest {
|
||||||
FaultAbort.forHeader(FaultConfig.FractionalPercent.perMillion(0)),
|
FaultAbort.forHeader(FaultConfig.FractionalPercent.perMillion(0)),
|
||||||
null);
|
null);
|
||||||
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
||||||
verify(mockListener, times(3)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener).onResult2(resolutionResultCaptor.capture());
|
||||||
result = resolutionResultCaptor.getValue();
|
result = resolutionResultCaptor.getValue();
|
||||||
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
||||||
|
@ -2084,7 +2066,7 @@ public class XdsNameResolverTest {
|
||||||
FaultConfig.FractionalPercent.perMillion(600_000)),
|
FaultConfig.FractionalPercent.perMillion(600_000)),
|
||||||
null);
|
null);
|
||||||
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
||||||
verify(mockListener, times(4)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener).onResult2(resolutionResultCaptor.capture());
|
||||||
result = resolutionResultCaptor.getValue();
|
result = resolutionResultCaptor.getValue();
|
||||||
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
||||||
|
@ -2102,7 +2084,7 @@ public class XdsNameResolverTest {
|
||||||
FaultConfig.FractionalPercent.perMillion(400_000)),
|
FaultConfig.FractionalPercent.perMillion(400_000)),
|
||||||
null);
|
null);
|
||||||
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
||||||
verify(mockListener, times(5)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener).onResult2(resolutionResultCaptor.capture());
|
||||||
result = resolutionResultCaptor.getValue();
|
result = resolutionResultCaptor.getValue();
|
||||||
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
||||||
|
@ -2137,7 +2119,7 @@ public class XdsNameResolverTest {
|
||||||
httpFilterFaultConfig = FaultConfig.create(
|
httpFilterFaultConfig = FaultConfig.create(
|
||||||
FaultDelay.forHeader(FaultConfig.FractionalPercent.perMillion(600_000)), null, null);
|
FaultDelay.forHeader(FaultConfig.FractionalPercent.perMillion(600_000)), null, null);
|
||||||
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
||||||
verify(mockListener, times(2)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener).onResult2(resolutionResultCaptor.capture());
|
||||||
result = resolutionResultCaptor.getValue();
|
result = resolutionResultCaptor.getValue();
|
||||||
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
||||||
|
@ -2148,7 +2130,7 @@ public class XdsNameResolverTest {
|
||||||
httpFilterFaultConfig = FaultConfig.create(
|
httpFilterFaultConfig = FaultConfig.create(
|
||||||
FaultDelay.forHeader(FaultConfig.FractionalPercent.perMillion(0)), null, null);
|
FaultDelay.forHeader(FaultConfig.FractionalPercent.perMillion(0)), null, null);
|
||||||
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
||||||
verify(mockListener, times(3)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener).onResult2(resolutionResultCaptor.capture());
|
||||||
result = resolutionResultCaptor.getValue();
|
result = resolutionResultCaptor.getValue();
|
||||||
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
||||||
|
@ -2161,7 +2143,7 @@ public class XdsNameResolverTest {
|
||||||
null,
|
null,
|
||||||
null);
|
null);
|
||||||
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
||||||
verify(mockListener, times(4)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener).onResult2(resolutionResultCaptor.capture());
|
||||||
result = resolutionResultCaptor.getValue();
|
result = resolutionResultCaptor.getValue();
|
||||||
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
||||||
|
@ -2174,7 +2156,7 @@ public class XdsNameResolverTest {
|
||||||
null,
|
null,
|
||||||
null);
|
null);
|
||||||
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
xdsClient.deliverLdsUpdateWithFaultInjection(cluster1, httpFilterFaultConfig, null, null, null);
|
||||||
verify(mockListener, times(5)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener).onResult2(resolutionResultCaptor.capture());
|
||||||
result = resolutionResultCaptor.getValue();
|
result = resolutionResultCaptor.getValue();
|
||||||
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
||||||
|
@ -2299,7 +2281,7 @@ public class XdsNameResolverTest {
|
||||||
null);
|
null);
|
||||||
xdsClient.deliverLdsUpdateWithFaultInjection(
|
xdsClient.deliverLdsUpdateWithFaultInjection(
|
||||||
cluster1, httpFilterFaultConfig, virtualHostFaultConfig, routeFaultConfig, null);
|
cluster1, httpFilterFaultConfig, virtualHostFaultConfig, routeFaultConfig, null);
|
||||||
verify(mockListener, times(2)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener).onResult2(resolutionResultCaptor.capture());
|
||||||
result = resolutionResultCaptor.getValue();
|
result = resolutionResultCaptor.getValue();
|
||||||
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
||||||
|
@ -2316,7 +2298,7 @@ public class XdsNameResolverTest {
|
||||||
xdsClient.deliverLdsUpdateWithFaultInjection(
|
xdsClient.deliverLdsUpdateWithFaultInjection(
|
||||||
cluster1, httpFilterFaultConfig, virtualHostFaultConfig, routeFaultConfig,
|
cluster1, httpFilterFaultConfig, virtualHostFaultConfig, routeFaultConfig,
|
||||||
weightedClusterFaultConfig);
|
weightedClusterFaultConfig);
|
||||||
verify(mockListener, times(3)).onResult2(resolutionResultCaptor.capture());
|
verify(mockListener).onResult2(resolutionResultCaptor.capture());
|
||||||
result = resolutionResultCaptor.getValue();
|
result = resolutionResultCaptor.getValue();
|
||||||
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
configSelector = result.getAttributes().get(InternalConfigSelector.KEY);
|
||||||
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
observer = startNewCall(TestMethodDescriptors.voidMethod(), configSelector,
|
||||||
|
|
Loading…
Reference in New Issue