hezean / sustc

Template for project 2 of SUSTech Principles of Database Systems (CS307 / CS213), 23 fall semester.
http://172.18.34.154
MIT License
22 stars 9 forks source link

[BenchMark] Number of Test Case Dismatch #86

Closed Cypher-Bruce closed 8 months ago

Cypher-Bruce commented 8 months ago

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

hezean commented 8 months ago

image

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

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

Cypher-Bruce commented 8 months ago

Thank you for your reply.