From 6879fdd505a0ef13e9ef0ddaec0aa04b47e87403 Mon Sep 17 00:00:00 2001 From: SaaiVenkat <46614118+SaaiVenkat@users.noreply.github.com> Date: Sun, 24 Dec 2023 06:24:55 -0600 Subject: [PATCH] Fix order dependent tests in SofaRpcFallbackRegistryTest (#3282) --- .../sofa/rpc/fallback/SofaRpcFallbackRegistryTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sentinel-adapter/sentinel-sofa-rpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/sofa/rpc/fallback/SofaRpcFallbackRegistryTest.java b/sentinel-adapter/sentinel-sofa-rpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/sofa/rpc/fallback/SofaRpcFallbackRegistryTest.java index 15930d10bd..9958723fe8 100644 --- a/sentinel-adapter/sentinel-sofa-rpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/sofa/rpc/fallback/SofaRpcFallbackRegistryTest.java +++ b/sentinel-adapter/sentinel-sofa-rpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/sofa/rpc/fallback/SofaRpcFallbackRegistryTest.java @@ -70,5 +70,9 @@ public SofaResponse handle(FilterInvoker invoker, SofaRequest request, BlockExce SofaResponse consumerResponse = SofaRpcFallbackRegistry.getConsumerFallback().handle(null, null, null); assertNotNull(consumerResponse); assertEquals("test consumer response", consumerResponse.getAppResponse()); + + // Reset to default provider and consumer fallback + SofaRpcFallbackRegistry.setProviderFallback(new DefaultSofaRpcFallback()); + SofaRpcFallbackRegistry.setConsumerFallback(new DefaultSofaRpcFallback()); } }