-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
test: mock cleanup #7922
test: mock cleanup #7922
Conversation
Signed-off-by: Alyssa Wilk <[email protected]>
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.
You are my hero! One question.
/wait-any
@@ -432,8 +432,9 @@ TEST_F(SquashFilterTest, TimerExpiresInline) { | |||
attachmentTimeout_timer_ = new NiceMock<Envoy::Event::MockTimer>(&filter_callbacks_.dispatcher_); | |||
EXPECT_CALL(*attachmentTimeout_timer_, enableTimer(config_->attachmentTimeout())) | |||
.WillOnce(Invoke([&](const std::chrono::milliseconds&) { | |||
attachmentTimeout_timer_->enabled_ = true; |
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.
Can this actually happen? I don't think so?
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 don't think the timer can be invoked literally under enabletimer. My guess is that's the only hook the test author had for squash finishing under async client -> send, but I was mainly trying to preserve existing tests as much as possible.
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.
Do you mind just adding a TODO to fix this test to make it more realistic? Thank you.
/wait
Signed-off-by: Alyssa Wilk <[email protected]>
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.
Thank you Alyssa!!! :)
Cleanup inspired by #7782 where I had to do a bunch of test cleanup because the tests were calling the callback directly rather than using invokeCallback()
This does lose us a synthetic validation in test/common/network/connection_impl_test.cc which the test admitted could not actually happen and from code inspection has been refactored to no longer look dangerous.
Risk Level: n/a (test only)
Testing: tests pass
Docs Changes: n/a
Release Notes: n/a