Repository navigation
Fix flaky histogram window ut - #3611
chenBright wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Polling transient histogram values remains unreliable when sampler updates are missed.
0 open findings
What changed in this PR
This PR improves histogram window test reliability by replacing fixed waits with polling and expiration checks.
Changes:
- Polls for asynchronous sampler updates.
- Extends retry windows.
- Validates expired histogram values.
| File | Summary |
|---|---|
test/bvar_histogram_unittest.cpp |
Updates histogram window timing and expiration assertions; polling can still miss transient results. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
wwbmmm
left a comment
There was a problem hiding this comment.
[replied by brpc-oncall robot] Test-only change: replacing the fixed sleeps with sampler-aware polling is the right direction and the new expiration assertions look correct, but the first polling phase of window_forgets_old_samples still depends on catching a transient window value, which can be missed on a busy host.
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
The comment says “100 ms per retry” but this hunk doesn’t show any sleep/backoff in the retry loop;… · Newstd::make_uniquerequires C++14; if this repo/tests are compiled as C++11 (common for older… · New This test now directly assigns toh._sampler, which tightly couples it tobvar::Histogram… · New
1 resolved since last review
Review effort: Lite
|
@wwbmmm The first two Copilot comments are false positives, and the third is an optional maintainability suggestion. No required fixes remain. This PR is ready to merge |
|
@wwbmmm PTAL. |

What problem does this PR solve?
Issue Number: resolve
Problem Summary:
Histogram window tests can fail under high CI load because fixed sleeps and short polling timeouts
do not guarantee that the background sampler has completed the required sampling rounds
What is changed and the side effects?
Changed:
Side effects:
Performance effects:
Breaking backward compatibility:
Check List: