sustc icon indicating copy to clipboard operation
sustc copied to clipboard

[BenchMark] Number of Test Case Dismatch

Open Cypher-Bruce opened this issue 2 years ago • 2 comments

Describe your question

When benchmarking online or locally for step 19 Test VideoService#reviewVideo(AuthInfo, String), my passcnt is 3. There is only 1 wrong answer debug info in the console. So the actual number of test case is 4? However, both the benchmark_small.json and OJ tell me number of test case is 35.

I try to add this code at the beginning of my reviewVideo function:

debug ++;
log.debug("VideoServiceImpl::reviewVideo: debug {}", debug);

where debug is a static variable for the impl class outside any function.

And the output in the console confirms there are only 4 test cases: image

Cypher-Bruce avatar Dec 25 '23 16:12 Cypher-Bruce

image

除了ser里的几个测试点,我们还测了review之前post的视频,这部分测试是并发的,你的debug变量如果是普通的int/long会没办法正确统计,因为race condition了,需要用atomic int来统计,参考benchmark service的写法

而且如果前面post video错了导致posted video记录少了,会影响到这个step的结果

hezean avatar Dec 25 '23 21:12 hezean

Thank you for your reply.

Cypher-Bruce avatar Dec 26 '23 01:12 Cypher-Bruce