Kaynağa Gözat

Update gRPC adapter test cases

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
master
Eric Zhao 6 yıl önce
ebeveyn
işleme
d29c4ca9c9
2 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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();
}


Yükleniyor…
İptal
Kaydet