test: split proc stat limit coverage by architecture#833
Open
happysnaker wants to merge 1 commit into
Open
Conversation
Signed-off-by: Shirong Lu <73147033+happysnaker@users.noreply.github.com>
4bece3b to
3fceaf6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #432.
This keeps the
ProcStatlimit coverage architecture-aware without relying on the shared 64-bit fixture values intestdata/fixtures.ttar.What changed
TestProcStatLimitsout ofproc_stat_test.goproc_maps*_test.go/proc/<pid>/statfixture per architecture, so the parsedCUTime/CSTimevalues match the nativeintwidth of that build targetWhy this shape
The earlier
math.MinInt/math.MaxIntconstant-only approach still leaves a mismatch with the shipped fixture data, which encodes 64-bit extrema for those fields. On 32-bit architectures that means the test can compile but the parsed values are still not representable as nativeints.Using a temporary
statfixture keeps the test focused on the parser behavior we want to validate on each target architecture, while leaving the shared repository fixtures unchanged.I did not run
go testhere; this patch is based on the issue discussion and static review only.