Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danzh2010
Copy link
Contributor

@danzh2010 danzh2010 commented May 9, 2024

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

Signed-off-by: Dan Zhang <danzh@google.com>
@danzh2010
Copy link
Contributor Author

/assign @ggreenway

Copy link
Contributor

@ggreenway ggreenway left a 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

@danzh2010
Copy link
Contributor Author

I don't understand; this flag isn't ever false in these tests, so it seems like this is dead code.

No, they are not dead code. Before this flag is introduced, these tests would make the client to send the connection option kSPAD to signal its support of SPA. This logic is accidentally removed when the flag is introduced, so these tests will fail when the flag is false.

@ggreenway
Copy link
Contributor

so these tests will fail when the flag is false

But the flag is never false in these tests. Otherwise, they'd be failing in CI everytime.

@danzh2010
Copy link
Contributor Author

so these tests will fail when the flag is false

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.

@danzh2010
Copy link
Contributor Author

so these tests will fail when the flag is false

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.

@danzh2010
Copy link
Contributor Author

/retest

@ggreenway
Copy link
Contributor

I think all tests should be written in a way that is robust to random flag flips.

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.

@danzh2010
Copy link
Contributor Author

I think all tests should be written in a way that is robust to random flag flips.

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.

@danzh2010
Copy link
Contributor Author

/retest

@@ -1905,6 +1905,12 @@ TEST_P(QuicHttpIntegrationTest, UsesPreferredAddress) {
});

initialize();
if (!Runtime::runtimeFeatureEnabled(
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

@ggreenway ggreenway May 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants