Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix flaky tests and fix passDefaultLocalCheck #3367

Merged
merged 7 commits into from Apr 17, 2024

Conversation

robberphex
Copy link
Collaborator

@robberphex robberphex commented Apr 4, 2024

Describe what this PR does / why we need it

  1. fix test case SentinelDubboConsumerFilterTest#testDegradeSync
    • When test is run slow, count bucket will count on next time span, causing failed test.
  2. fix testParamFlowDefaultCheckSingleValueCheckQpsMultipleThreads by rule.setDurationInSec(2)
    • set threshold as count in 2 seconds to prevent the failure of the unit test when the unit test runs longer than 1 second.
  3. fix quarkus test by set /txt sleep 300
    • If /txt sleep 500 ms, in testSentinelJaxRsQuarkusAdapter, may cause 2 request intervals of more than 1 s, which cause rate limit policy is not effective.
  4. fix testDegradeAsync
    • When test is run slow, count bucket will count on next time span, causing failed test.
  5. use testcontainers to fix testConsulDataSourceWhenInit
    • Project embedded-consul has been deprecated in favour of org.testcontainers:consul
    • use consul testcontainers to fix testConsulDataSourceWhenInit, which means docker is required to run tests.
      Error:  com.alibaba.csp.sentinel.datasource.consul.ConsulDataSourceTest.testConsulDataSourceWhenInit -- Time elapsed: 34.47 s <<< ERROR!
        com.pszymczyk.consul.EmbeddedConsulException: Could not start Consul process in 30 seconds
              at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
              at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
              at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
              at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
      
  6. fix [BUG] passDefaultLocalCheck pass request more than limit #3366
    • introduce intermediate node TokenUpdateStatus to avoid ABA problem

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

* When test is run slow, count bucket will count on next time span, causing failed test.
…le.setDurationInSec(2)

* set threshold as count in 2 seconds to prevent the failure of the unit test when the unit test runs longer than 1 second.
* If /txt sleep 500 ms, in testSentinelJaxRsQuarkusAdapter, may cause 2 request intervals of more than 1 s, which cause rate limit policy is not effective.
* When test is run slow, count bucket will count on next time span, causing failed test.
* Project embedded-consul has been deprecated in favour of org.testcontainers:consul
* use consul testcontainers to fix testConsulDataSourceWhenInit, which means docker is required to run tests.
```
Error:  com.alibaba.csp.sentinel.datasource.consul.ConsulDataSourceTest.testConsulDataSourceWhenInit -- Time elapsed: 34.47 s <<< ERROR!
  com.pszymczyk.consul.EmbeddedConsulException: Could not start Consul process in 30 seconds
  	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
  	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
  	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
  	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
 ```
@robberphex robberphex changed the title fix flaky tests fix flaky tests and fix passDefaultLocalCheck Apr 4, 2024
@LearningGp LearningGp merged commit cd02b1d into alibaba:1.8 Apr 17, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] passDefaultLocalCheck pass request more than limit
2 participants