Sentinel [bug] test case ParamFlowDefaultCheckerTest#testParamFlowDefaultCheckSingleValueCheckQpsMultipleThreads() assert error

nwwlzxa7  于 2021-11-29  发布在  Java
关注(0)|答案(3)|浏览(327)

// 我看到社区大家都用中文,我也用中文好了

Issue Description

单元测试运行失败,或许是测试用例逻辑错误,或许是代码被修改后逻辑不符合预期

Describe what happened (or what feature you want)

我试着运行这个项目,但在check阶段出现了测试错误,或许是测试逻辑问题,或许是代码本身有bug

How to reproduce it (as minimally and precisely as possible)

1.拉取master最新的代码

  1. run :
    mvn clean install

ParamFlowDefaultCheckerTest 状态为未通过

  1. run :
    mvn test

ParamFlowDefaultCheckerTest 状态为未通过

4.单独运行ParamFlowDefaultCheckerTest
方法testParamFlowDefaultCheckSingleValueCheckQpsMultipleThreads()Assert失败

java.lang.AssertionError: 
Expected :8
Actual   :5

... ...
	at com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowDefaultCheckerTest.testParamFlowDefaultCheckSingleValueCheckQpsMultipleThreads(ParamFlowDefaultCheckerTest.java:323)
... ...
  1. 重复运行testParamFlowDefaultCheckSingleValueCheckQpsMultipleThreads()Assert成功
  2. 多次重复运行testParamFlowDefaultCheckSingleValueCheckQpsMultipleThreads()会出现Assert失败
java.lang.AssertionError: 
Expected :6
Actual   :5

... ...
	at com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowDefaultCheckerTest.testParamFlowDefaultCheckSingleValueCheckQpsMultipleThreads(ParamFlowDefaultCheckerTest.java:323)
... ...

多次运行的结果:会出现几率性运行成功,但大概率会失败

Tell us your environment

oracle-jdk8 / master/ mac0s

使用oracle-jdk16 OccupiableBucketLeapArrayTest会实现失败,目前尚未确定是否是因为jdk版本缘故

Anything else we need to know?

nzk0hqpo

nzk0hqpo1#

@sczyh30@li-keguo I tried to run the Unit tests which you mentioned, as you can see in the attached screenshot, all are working fine

cmssoen2

cmssoen22#

This is a flaky test that may be affected by time (may not be reproduced every time). Discussions are welcomed.

ws51t4hk

ws51t4hk3#

Maybe you should try a few more times.

The result may be different each time

There is a success situation

相关问题