소스 검색

Update gRPC adapter test cases

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
master
Eric Zhao 6 년 전
부모
커밋
d29c4ca9c9
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  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 파일 보기

@@ -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 파일 보기

@@ -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…
취소
저장