Skip to content

Comments

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

Merged
ti-mo merged 1 commit intocilium:mainfrom
ti-mo:tb/hyrums-law
Mar 4, 2024
Merged

test: don't rely on append() to copy base slice#1367
ti-mo merged 1 commit intocilium:mainfrom
ti-mo:tb/hyrums-law

Conversation

@ti-mo
Copy link
Contributor

@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 <[email protected]>
@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
@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