New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FaultInjection: Fix random number generation #30623
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good! Just one comment to address.
@@ -204,7 +204,13 @@ TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageAbortViaHeaders) { | |||
|
|||
TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageDelay) { | |||
CreateAndStartBackends(1); | |||
const uint32_t kFixedDelayMilliseconds = 100000; | |||
#ifndef NDEBUG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really not keen on putting #ifndef
s in the middle of individual tests. Can we not just increase the timeout even for opt builds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
77ff4c2
to
9b93d05
Compare
Thanks for reviewing! |
rand()
is not thread-safe, so instead useabsl::InsecureBitGen
andabsl::Uniform
to generate random numbers.