From 1f996311226f38bfc7dfa53edccd9bbb91afb702 Mon Sep 17 00:00:00 2001 From: rblake2320 <73768949+rblake2320@users.noreply.github.com> Date: Thu, 30 Jul 2026 13:40:46 -0500 Subject: [PATCH] stabilize Redis OOM CI check --- redis-nonce-integration.mts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/redis-nonce-integration.mts b/redis-nonce-integration.mts index 89564cc..8eea47f 100644 --- a/redis-nonce-integration.mts +++ b/redis-nonce-integration.mts @@ -375,11 +375,11 @@ try { await establishContinuity(oomNamespace, 'epoch-before-oom'); const oomStore = await governed(redis, oomNamespace); try { - const memoryInfo = await redis.info('memory'); - const usedMatch = /^used_memory:(\d+)$/m.exec(memoryInfo); - if (!usedMatch) throw new Error('Redis INFO did not expose used_memory'); await redis.config('SET', 'maxmemory-policy', 'noeviction'); - await redis.config('SET', 'maxmemory', String(Math.max(1, Number(usedMatch[1]) - 1))); + // A limit derived from an INFO snapshot is racy: Redis can reclaim memory + // before the authorization write and make a nominally over-limit write + // succeed. One byte is deterministically below the server's baseline. + await redis.config('SET', 'maxmemory', '1'); const oomRequest = requestFromHeaders(await client.signRequest('GET', '/api/data')); const oomResult = await verifyBPCRequest(