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

vdk-test-utils: Measure payload size with len, not getsizeof #3157

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

gabrielgeorgiev1
Copy link
Contributor

Previously, the size of payloads was measured using sys.getsizeof when testing. This is suboptimal, since different versions of Python might give different sizes (and in particular, when using Python3.12, the size of payloads is 8 bytes less than in previous versions). To address this, we now use len to measure the payload size, which should be consistent across all Python versions.

The relevant tests in vdk-core have been adjusted to address this change.

Testing done: cicd

Previously, the size of payloads was measured using sys.getsizeof
when testing. This is suboptimal, since different versions of
Python might give different sizes (and in particular, when using
Python3.12, the size of payloads is 8 bytes less than in previous
versions). To address this, we now use len to measure the payload
size, which should be consistent across all Python versions.

The relevant tests in vdk-core have been adjusted to address this
change.

Testing done: cicd

Signed-off-by: Gabriel Georgiev <[email protected]>
@gabrielgeorgiev1 gabrielgeorgiev1 merged commit 4e3b400 into main Feb 23, 2024
13 checks passed
@gabrielgeorgiev1 gabrielgeorgiev1 deleted the person/gageorgiev/testutilchange branch February 23, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants