You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use sentinel to implement resiliency for by web services.
I found it is very difficult to write multiple test for the same resource with different rules because sentinel keep context for for when another test run from the previous test.
For example sentinel_block_requests_total is already not null when the second test is running.
How to reset/clean all sentinel counts before each test using public API?
I use the following code:
ClusterNode node = ClusterBuilderSlot.getClusterNode(nodeName);
if (node!=null) {
node.reset();
node.metrics().clear();
node.metrics().values().clear();
}
But it does not help
I still see not null total counts
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I use sentinel to implement resiliency for by web services.
I found it is very difficult to write multiple test for the same resource with different rules because sentinel keep context for for when another test run from the previous test.
For example sentinel_block_requests_total is already not null when the second test is running.
How to reset/clean all sentinel counts before each test using public API?
I use the following code:
ClusterNode node = ClusterBuilderSlot.getClusterNode(nodeName);
if (node!=null) {
node.reset();
node.metrics().clear();
node.metrics().values().clear();
}
But it does not help
I still see not null total counts
Beta Was this translation helpful? Give feedback.
All reactions