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
In com.alibaba.csp.sentinel.adapter.sofa.rpc.fallback.SofaRpcFallbackRegistryTest, the unit test testDefaultfallback() will fail when run after the unit test testCustomFallback().
This is because the tests SofaRpcFallbackRegistryTest.testCustomFallback() pollutes the shared states SofaRpcFallback.providerFallback and SofaRpcFallback.consumerFallback between tests at
However, these states aren't cleaned after the test testCustomFallback() is run causing the above mentioned test to fail
Describe what you expected to happen
The unit tests in com.alibaba.csp.sentinel.adapter.sofa.rpc.fallback.SofaRpcFallbackRegistryTest should pass when run in any order
How to reproduce it (as minimally and precisely as possible)
In com.alibaba.csp.sentinel.adapter.sofa.rpc.fallback.SofaRpcFallbackRegistryTest, run the following unit tests in order
testCustomFallback()
testDefaultFallback()
Running the tests in the above manner will produce java.lang.AssertionError
java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.assertTrue(Assert.java:41)
at org.junit.Assert.assertTrue(Assert.java:52)
at com.alibaba.csp.sentinel.adapter.sofa.rpc.fallback.SofaRpcFallbackRegistryTest.testDefaultfallback(SofaRpcFallbackRegistryTest.java:42)
Tell us your environment
Sentinel: 1.8.6
OS: Mac OS X 14.0 aarch64
Java: 17.0.9 or 1.8.0_381
Anything else we need to know?
I have raised a PR Fix order dependent tests in SofaRpcFallbackRegistryTest #3282 to fix this issue by resetting the polluter states SofaRpcFallback.providerFallback and SofaRpcFallback.consumerFallback to its default value after the test SofaRpcFallbackRegistryTest.testCustomFallback() is executed.
The text was updated successfully, but these errors were encountered:
Issue Description
Type: bug report
Describe what happened
com.alibaba.csp.sentinel.adapter.sofa.rpc.fallback.SofaRpcFallbackRegistryTest
, the unit testtestDefaultfallback()
will fail when run after the unit testtestCustomFallback()
.SofaRpcFallbackRegistryTest.testCustomFallback()
pollutes the shared statesSofaRpcFallback.providerFallback
andSofaRpcFallback.consumerFallback
between tests atSentinel/sentinel-adapter/sentinel-sofa-rpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/sofa/rpc/fallback/SofaRpcFallbackRegistryTest.java
Line 49 in 5108046
Sentinel/sentinel-adapter/sentinel-sofa-rpc-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/sofa/rpc/fallback/SofaRpcFallbackRegistryTest.java
Line 62 in 5108046
testCustomFallback()
is run causing the above mentioned test to failDescribe what you expected to happen
com.alibaba.csp.sentinel.adapter.sofa.rpc.fallback.SofaRpcFallbackRegistryTest
should pass when run in any orderHow to reproduce it (as minimally and precisely as possible)
com.alibaba.csp.sentinel.adapter.sofa.rpc.fallback.SofaRpcFallbackRegistryTest
, run the following unit tests in ordertestCustomFallback()
testDefaultFallback()
java.lang.AssertionError
Tell us your environment
1.8.6
Mac OS X 14.0 aarch64
17.0.9
or1.8.0_381
Anything else we need to know?
SofaRpcFallback.providerFallback
andSofaRpcFallback.consumerFallback
to its default value after the testSofaRpcFallbackRegistryTest.testCustomFallback()
is executed.The text was updated successfully, but these errors were encountered: