Giter Site home page Giter Site logo

Comments (2)

robberphex avatar robberphex commented on May 28, 2024

And here is the log,

testParamFlowDefaultCheckSingleValueCheckQpsMultipleThreads: sleep for 3 seconds
189:passDefaultLocalCheck:2024-03-28T17:08:36.698,currentTime:1711645716698,passTime:3014,oldQps:4
200:passDefaultLocalCheck:2024-03-28T17:08:36.699,currentTime:1711645716698
200:passDefaultLocalCheck:2024-03-28T17:08:36.699,currentTime:1711645716698
200:passDefaultLocalCheck:2024-03-28T17:08:36.699,currentTime:1711645716699
200:passDefaultLocalCheck:2024-03-28T17:08:36.699,currentTime:1711645716699
200:passDefaultLocalCheck:2024-03-28T17:08:36.699,currentTime:1711645716699
200:passDefaultLocalCheck:2024-03-28T17:08:36.7,currentTime:1711645716699
189:passDefaultLocalCheck:2024-03-28T17:08:36.699,currentTime:1711645716698,passTime:3014,oldQps:0
[ERROR] Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.613 s <<< FAILURE! -- in com.alibaba.csp.sentinel.slots.block.flow.param.
[ERROR] com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowDefaultCheckerTest.testParamFlowDefaultCheckSingleValueCheckQpsMultipleThreads -- LURE!
java.lang.AssertionError: expected:<5> but was:<8>
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failNotEquals(Assert.java:834)
	at org.junit.Assert.assertEquals(Assert.java:645)
	at org.junit.Assert.assertEquals(Assert.java:631)
	at com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowDefaultCheckerTest.testParamFlowDefaultCheckSingleValueCheckQpsMultipleThreadsjava:320)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)

from sentinel.

robberphex avatar robberphex commented on May 28, 2024

This is a typical ABA Problem. And on passDefaultLocalCheck, we maintain two variables status and keep them in sync(restQps&lastAddTokenTime).

With this background, we could introduce TokenUpdateStatus, to record restQps&lastAddTokenTime, and update in atomic way..

from sentinel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.