Repository navigation
Make two tests fit 32-bit platforms - #1
Merged
Merged
Conversation
The first CI run failed in the 32-bit job, for two reasons that have nothing to do with the caches, whose own tests pass there. The inlining check expects what the compiler inlines on amd64 and arm64. On 386 an atomic operation is a call to a few lines of assembly, so the check cannot hold; it now skips on other architectures. TestIndexSize multiplied the largest index size by two in a uint, which overflows 32 bits. The function it tests was right. Co-Authored-By: Claude <noreply@anthropic.com>
The 32-bit job then failed in another place: a test that counts the keys a cache keeps alive found 32 where 16 are allowed, and 24 after Clear, once, in s3fifo, after it had passed in the run before. No reader touches the cache in that test, so the cache has no reason to hold on to anything, and Clear does not return while it does. What is left is the collector: of a goroutine that it stops in the middle of something it searches the topmost frame for anything that looks like a pointer, and stale stack memory may hold pointers to what a test has dropped. That is transient, where a cache that fails to let go is not. The tests that assert that values are gone now share a helper that runs the collector again while more of them are alive than may be. Co-Authored-By: Claude <noreply@anthropic.com>
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.
The first CI run on
mainfailed in thetest-32-bitjob only. Both failures are in tests, not in the caches, whose own tests pass on 32-bit in that run.internal/inlinecheck): it expects what the compiler inlines on amd64 and arm64. On 386 an atomic operation is a call to a few lines of assembly, so the expectation cannot hold there. The test now skips on other architectures.TestIndexSize(internal/slab): the test multiplied the largest index size by two in auint, which overflows 32 bits. The function under test was right; the check now uses 64 bits.Checked locally: both tests pass on arm64, and every test binary compiles for
linux/386andlinux/arm. The 32-bit tests themselves cannot run on the machine this was written on, so thetest-32-bitjob of this pull request is the real check.🤖 Generated with Claude Code