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

test: don't rely on append() to copy base slice #1367

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

ti-mo
Copy link
Collaborator

@ti-mo ti-mo commented Mar 4, 2024

TestProgramVerifierLogTruncated broke when upgrading from Go 1.21.7 to 1.22.0. The test implicitly relied on append() performing a copy() behind the scenes when the base slice is grown beyond 32 elements, but Go 1.22 changed something about when and how this growing takes place. We shouldn't depend on this behaviour.

Made an issue about this upstream (golang/go#66093) just in case this was not intended.

TestProgramVerifierLogTruncated broke when upgrading from Go 1.21.7 to 1.22.0.
The test implicitly relied on append() performing a copy() behind the scenes
when the base slice is grown beyond 32 elements, but Go 1.22 changed something
about when and how this growing takes place. We shouldn't depend on this
behaviour.

Signed-off-by: Timo Beckers <timo@isovalent.com>
@ti-mo ti-mo requested a review from a team as a code owner March 4, 2024 16:22
@ti-mo ti-mo merged commit c74a234 into cilium:main Mar 4, 2024
15 checks passed
@ti-mo ti-mo deleted the tb/hyrums-law branch March 4, 2024 16:40
@ti-mo ti-mo mentioned this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant