From e6633146d8ec535b07e486006be2e80ffceb255f Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 17 Oct 2026 20:30:21 -0700 Subject: [PATCH] filer: shrink zip spool threshold in tests to fix 32-bit OOM (#11801) * filer: shrink zip spool threshold in tests to fix 32-bit OOM TestSpoolZipReaderTempFile and TestSpoolZipReaderLimit each allocate ~33-70 MiB to cross the 32 MiB in-memory spool threshold. On linux/386 the weed/filer test binary already runs near the 4 GiB address-space limit, so these allocations reliably crash it with "out of memory" mid-suite. Make zipSpoolMemoryLimit a var and drop it to 1 KiB in those tests, which exercises the same memory-vs-temp-file spool paths with KiB-sized buffers. * s3 lifecycle: update stale runShard and WalkerFunc call sites in tests Recent master changes added a walks param to runShard (#11797) and made WalkerFunc take []int, but replay_view_test.go and run_bounded_test.go still use the old signatures, breaking go vet and test builds on merge. --- weed/s3api/s3lifecycle/dailyrun/replay_view_test.go | 2 +- weed/s3api/s3lifecycle/dailyrun/run_bounded_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/s3api/s3lifecycle/dailyrun/replay_view_test.go b/weed/s3api/s3lifecycle/dailyrun/replay_view_test.go index 8adb1da41..1dc3475fc 100644 --- a/weed/s3api/s3lifecycle/dailyrun/replay_view_test.go +++ b/weed/s3api/s3lifecycle/dailyrun/replay_view_test.go @@ -60,7 +60,7 @@ func TestRunShard_WalkBoundRuleDoesNotPinCursor(t *testing.T) { close(events) client := &recordingClient{} cfg := Config{Persister: p, Client: client, Lister: stubSiblingLister{}, RetentionWindow: retention} - require.NoError(t, runShard(context.Background(), cfg, snap, runNow, 0, events)) + require.NoError(t, runShard(context.Background(), cfg, snap, runNow, 0, events, nil)) assert.ElementsMatch(t, []string{"short/a", "short/b"}, client.seenObjects()) got, _, _ := p.Load(context.Background(), 0) assert.Equal(t, last.TsNs, got.TsNs, "cursor must advance past the walk-bound object's PUT") diff --git a/weed/s3api/s3lifecycle/dailyrun/run_bounded_test.go b/weed/s3api/s3lifecycle/dailyrun/run_bounded_test.go index 377f3444a..ab241f114 100644 --- a/weed/s3api/s3lifecycle/dailyrun/run_bounded_test.go +++ b/weed/s3api/s3lifecycle/dailyrun/run_bounded_test.go @@ -225,7 +225,7 @@ func TestValidate_RejectsRetentionWindowWithoutWalker(t *testing.T) { cfg := validatableConfig() cfg.RetentionWindow = 24 * time.Hour require.ErrorContains(t, validate(cfg), "RetentionWindow") - cfg.Walker = func(context.Context, *engine.Snapshot, int) error { return nil } + cfg.Walker = func(context.Context, *engine.Snapshot, []int) error { return nil } require.NoError(t, validate(cfg)) cfg.Walker = nil cfg.RetentionWindow = 0