Browse Source

Update gRPC adapter test cases

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
master
Eric Zhao 6 years ago
parent
commit
d29c4ca9c9
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcClientInterceptorTest.java
  2. +2
    -2
      sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcServerInterceptorTest.java

+ 2
- 2
sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcClientInterceptorTest.java View File

@@ -65,14 +65,14 @@ public class SentinelGrpcClientInterceptorTest {
assertTrue(sendRequest(client));
ClusterNode clusterNode = ClusterBuilderSlot.getClusterNode(resourceName, EntryType.OUT);
assertNotNull(clusterNode);
assertEquals(1, clusterNode.passQps());
assertEquals(1, clusterNode.totalRequest() - clusterNode.blockRequest());

// Not allowed to pass.
configureFlowRule(0);

// The second request will be blocked.
assertFalse(sendRequest(client));
assertEquals(1, clusterNode.blockQps());
assertEquals(1, clusterNode.blockRequest());

server.stop();
}


+ 2
- 2
sentinel-adapter/sentinel-grpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/grpc/SentinelGrpcServerInterceptorTest.java View File

@@ -66,14 +66,14 @@ public class SentinelGrpcServerInterceptorTest {
assertTrue(sendRequest());
ClusterNode clusterNode = ClusterBuilderSlot.getClusterNode(resourceName, EntryType.IN);
assertNotNull(clusterNode);
assertEquals(1, clusterNode.passQps());
assertEquals(1, clusterNode.totalRequest() - clusterNode.blockRequest());

// Not allowed to pass.
configureFlowRule(0);

// The second request will be blocked.
assertFalse(sendRequest());
assertEquals(1, clusterNode.blockQps());
assertEquals(1, clusterNode.blockRequest());

server.stop();
}


Loading…
Cancel
Save