runtime/pprof: make TestConvertCPUProfile more resilient #56311
+32
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates the test to be more forgiving when it comes to how a processes memory maps are laid out.
I (at Red Hat) maintain a fork of Go which adds the ability to use OpenSSL for cryptography, mostly for FIPS compliance. Due to differences in our fork with out changes applied the information in
/proc/self/maps
ends up being different than what the currentruntime/pprof.TestConvert{CPU,Mem}Profile
expects. This patch makes the test more resilient to different address space layouts.This test is not failing with the current Go builds, only with our changes applied, but this fix makes the test more resilient overall and does not break with the existing implementation, so rather than carry yet another downstream patch I think it makes the most sense to submit this fix upstream.
Fixes golang-fips/go#50