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

[stream info] [test] Fix broken StreamInfoImpl test #37619

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

[stream info] Fix broken StreamInfoImpl test

a9ccb02
Select commit
Loading
Failed to load commit list.
Open

[stream info] [test] Fix broken StreamInfoImpl test #37619

[stream info] Fix broken StreamInfoImpl test
a9ccb02
Select commit
Loading
Failed to load commit list.
CI (Envoy) / Envoy/Checks succeeded Dec 11, 2024 in 9m 48s

Envoy/Checks (success)

Check has finished

Details

Check run finished (success ✔️)

The check run can be viewed here:

Envoy/Checks (pr/37619/main@a9ccb02)

Check started by

Request (pr/37619/main@a9ccb02)

krinkinmu @krinkinmu a9ccb02 #37619 merge main@8abdde3

[stream info] [test] Fix broken StreamInfoImpl test

Commit Message:

I'm not fully familiar with the background of the assertStreamInfoSize, but it appears that the purpose of this check is to make sure that changes to StreamInfoImpl aren't going to break setFromForRecreateStream or setFrom.

Ideally we would not rely on such a test and instead test setFromForRecreateStream functionality directly, but I understand that it might be difficult to come up with a good test that covers all the cases.

However, this test was apprently broken by
#35650. This PR addedd a new field to the StreamInfoImpl changing the layout of the structure and with that the test.

Interestingly enough, the same PR actually updated StreamInfoImpl::setFrom function (which the test reminds us to do every time we change StreamInfoImpl), but at the same time it didn't change the test.

Anyways, keeping the status quo until we have a good alternative solution I'm fixing this test and add some comments in the check to give folks a clue as to why sizeof(StreamInfoImpl) may return different values and, consequently, how to change this test after changes to StreamInfoImpl.

I also noticed that the list of possible values for the size of StreamInfoImpl is way too long - we don't have that many different ABIs - and contains a duplicate, so I cleaned the list and reduced it to 3 values. One thing in mind, is that I didn't test it on ARM platforms - from all I know it should not make a difference, but it's something to keep in mind.

I will see in spare time if I can replace this test with something else that does not rely on a specific layout of the StreamInfoImpl structure.

Additional Description:
Risk Level: Low
Testing:

bazel test //test/common/stream_info:stream_info_impl_test --config=docker-clang
bazel test //test/common/stream_info:stream_info_impl_test --config=docker-msan
bazel test //test/common/stream_info:stream_info_impl_test --config=docker-clang-libc++

With -c opt and -c dbg to make sure that optimization don't affect the ABI (which is expected, but just in case).

Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
Fixes commit #35650

Environment

Request variables

Key Value
ref 63e50bc
sha a9ccb02
pr 37619
base-sha 8abdde3
actor krinkinmu @krinkinmu
message [stream info] [test] Fix broken StreamInfoImpl test...
started 1733936610.516421
target-branch main
trusted false
Build image

Container image/s (as used in this CI run)

Key Value
default envoyproxy/envoy-build-ubuntu:f94a38f62220a2b017878b790b6ea98a0f6c5f9c
mobile envoyproxy/envoy-build-ubuntu:mobile-f94a38f62220a2b017878b790b6ea98a0f6c5f9c
Version

Envoy version (as used in this CI run)

Key Value
major 1
minor 33
patch 0
dev true