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
quic: fix Server's Preferred Address tests to when envoy.reloadable_features.quic_send_server_preferred_address_to_all_clients
is false
#34052
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Dan Zhang <danzh@google.com>
/assign @ggreenway |
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 understand; this flag isn't ever false in these tests, so it seems like this is dead code.
/wait-any
No, they are not dead code. Before this flag is introduced, these tests would make the client to send the connection option |
But the flag is never false in these tests. Otherwise, they'd be failing in CI everytime. |
The issue is that we flipped the flag internally and these tests were not happy. |
I think all tests should be written in a way that is robust to random flag flips. |
/retest |
Most/all of the envoy tests are written to assume the default value for the flags (or the test explicitly flips the flag to test the opposite case); I don't think anything like this has been done before. |
@alyssawilk who originally implemented runtime guard. If tests only work for default values, it will be hard time to turn off the flags when issues are reported with the flag. |
/retest |
@@ -1905,6 +1905,12 @@ TEST_P(QuicHttpIntegrationTest, UsesPreferredAddress) { | |||
}); | |||
|
|||
initialize(); | |||
if (!Runtime::runtimeFeatureEnabled( |
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 support tests working with flipped flags. That said if the test doesn't work without server preferred address, why not just latch it true for these tests? then they'd pass even if the flag was default false.
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.
We actually want to test the functionality with this flag set to false as well.
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.
if you want to test the functionality with it explicit false I encourage more tests like TEST_P(QuicHttpIntegrationTest, PreferredAddressRuntimeFlag) {
which explicitly set it to false.
You could have standard tests like that, and then have the test BUILD have
--runtime-feature-override-for-tests=quic_send_server_preferred_address_to_all_clients to handle internal import
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 think if the goal is to make tests pass if the default flag value is changed, just override the flag value at the beginning of the test.
If the goal is to test the quiche client code in both modes, do the above, and add an additional copy of the test with the flag forced to the other mode and the required bits to make it work in that mode.
With how it's written now, there is code that is never run in envoy CI, so if someone makes changes there that don't work, we wouldn't know.
Those tests were accidentally changed pass only if that runtime guard is true.
Risk Level: low
Testing: fixing tests
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A