chenBright opened a new pull request, #3567:
URL: https://github.com/apache/brpc/pull/3567
### What problem does this PR solve?
Issue Number: resolve
Problem Summary:
`HistogramTest.window` relied on fixed one-second sleeps to wait for the
asynchronous global sampler. Under high CI load, the sampler may not run after
the final write in time, causing the window value to miss one sample.
```text
[ RUN ] HistogramTest.window
test/bvar_histogram_unittest.cpp:715: Failure
Expected equality of these values:
3
wv.num
Which is: 2
Stack trace:
0x5582186179e7: (anonymous
namespace)::HistogramTest_window_Test::TestBody()
0x7f0ead1f9195:
testing::internal::HandleSehExceptionsInMethodIfSupported<>()
0x7f0ead1f2689: testing::internal::HandleExceptionsInMethodIfSupported<>()
0x7f0ead1cf07e: testing::Test::Run()
0x7f0ead1cfb58: testing::TestInfo::Run()
... Google Test internal frames ...
```
### What is changed and the side effects?
Changed:
- Replace fixed sleeps with polling for the expected window value, with a
bounded timeout.
- Record all test samples before waiting for the sampler.
Side effects:
- Performance effects:
- Breaking backward compatibility:
---
### Check List:
- [x] Please make sure your changes are compilable.
- [x] When providing us with a new feature, it is best to add related tests.
- [x] 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]