Skip to content

Make two tests fit 32-bit platforms - #1

Merged
floatdrop merged 2 commits into
mainfrom
fix-32-bit-tests
Nov 11, 2026
Merged

floatdrop merged 2 commits into
mainfrom
fix-32-bit-tests

Conversation

@floatdrop

Copy link
Copy Markdown
Owner

The first CI run on main failed in the test-32-bit job only. Both failures are in tests, not in the caches, whose own tests pass on 32-bit in that run.

  • Inlining check (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 a uint, 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/386 and linux/arm. The 32-bit tests themselves cannot run on the machine this was written on, so the test-32-bit job of this pull request is the real check.

🤖 Generated with Claude Code

floatdrop and others added 2 commits November 11, 2026 10:20
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>
@floatdrop
floatdrop merged commit c72dc1a into main Nov 11, 2026
14 checks passed
@floatdrop
floatdrop deleted the fix-32-bit-tests branch November 11, 2026 05:42
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