songgaoye opened a new pull request, #3651: URL: https://github.com/apache/brpc/pull/3651
### What problem does this PR solve? Issue Number: resolve Problem Summary: `RecorderTest.latency_recorder_qps_accuracy` is flaky because it calculates the expected QPS from one window sample and then reads `qps()` separately. A sampler tick can occur between those reads, causing them to refer to different windows and resulting in intermittent zero or inaccurate QPS assertions. ### What is changed and the side effects? Changed: - Retry the QPS assertion when the latency-window sample changes between reads. - Compare `qps()` with the expected value only when the samples immediately before and after the QPS read have the same timestamp. Side effects: - Performance effects: Test-only change. Negligible additional polling in the rare case of a sampler tick during validation. - Breaking backward compatibility: None. --- ### Check List: - Please make sure your changes are compilable. - When providing us with a new feature, it is best to add related tests. - Please follow [Contributor Covenant Code of Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
