From 1912740ac3bdfaf607adf28abf05136daafdcea7 Mon Sep 17 00:00:00 2001 From: Radu Berinde Date: Sat, 12 Apr 2025 08:48:38 -0700 Subject: [PATCH] metamorphic: reduce test size for 32-bit This test occasionally OOMs with `GOARCH=386`. Reduce the size of the test for 32-bit builds. --- internal/metamorphic/metaflags/meta_flags.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/metamorphic/metaflags/meta_flags.go b/internal/metamorphic/metaflags/meta_flags.go index 830bb1cf95..d98ceaf38f 100644 --- a/internal/metamorphic/metaflags/meta_flags.go +++ b/internal/metamorphic/metaflags/meta_flags.go @@ -15,6 +15,7 @@ import ( "regexp" "strings" "time" + "unsafe" "github.com/cockroachdb/pebble/internal/buildtags" "github.com/cockroachdb/pebble/internal/randvar" @@ -176,8 +177,9 @@ func initRunFlags(c *CommonFlags) *RunFlags { "write an execution trace to `/file`") ops := "uniform:5000-10000" - if buildtags.SlowBuild { - // Reduce the size of the test under race (to avoid timeouts). + if buildtags.SlowBuild || unsafe.Sizeof(uintptr(0)) == 4 { + // Reduce the size of the test in slow builds (to avoid timeouts) or 32-bit + // builds (to avoid OOMs). ops = "uniform:1000-2000" } if err := r.Ops.Set(ops); err != nil {