Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

fix(smoke-test): trigger the memory-limit check from a code step, not an expression (#15785)

Hazem Adel3a751c06abbc
diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml
index 35dcb32b2ff..943f868b681 100644
--- a/.github/workflows/smoke-test.yml
+++ b/.github/workflows/smoke-test.yml
@@ -79,7 +79,7 @@ jobs:
# can't exercise isolation here (it returns no data and the gate fails spuriously). Run it
# locally with `benchmark/probe-fs.js` + `smoke-test/verify-isolation.sh` (both kept in repo).
- # Memory-limit detection gate (same SANDBOX_CODE_ONLY stack): the OOM input expression blows
+ # Memory-limit detection gate (same SANDBOX_CODE_ONLY stack): the OOM code step blows
# the ENGINE heap via the isolate->engine result copy, and AP_WORKER_CONCURRENCY=1 (job env)
# gives that single sandbox the full 1G worker container. Every run must end
# MEMORY_LIMIT_EXCEEDED — this pins the detection path for production code-only engine OOMs.
@@ -87,7 +87,7 @@ jobs:
if: matrix.executionMode == 'SANDBOX_CODE_ONLY'
id: setup-oom
run: |
- FLOW_ID=$(CODE_INPUT_SUM="$(cat benchmark/oom-expression.txt)" benchmark/setup.sh)
+ FLOW_ID=$(CODE_BODY_FILE=benchmark/oom-code.js benchmark/setup.sh)
echo "flow_id=$FLOW_ID" >> "$GITHUB_OUTPUT"
echo "Flow ID: $FLOW_ID"
diff --git a/benchmark/oom-code.js b/benchmark/oom-code.js
new file mode 100644
index 00000000000..6071e0746c6
--- /dev/null
+++ b/benchmark/oom-code.js
@@ -0,0 +1,8 @@
+export const code = async () => {
+ const chunk = 'x'.repeat(52428800);
+ const hog = [];
+ for (let i = 0; i < 64; i = i + 1) {
+ hog.push(chunk);
+ }
+ return hog;
+};
diff --git a/benchmark/oom-expression.txt b/benchmark/oom-expression.txt
deleted file mode 100644
index 4dfa9e3bf38..00000000000
--- a/benchmark/oom-expression.txt
+++ /dev/null
@@ -1 +0,0 @@
-{{ (function () { const chunk = 'x'.repeat(52428800); const hog = []; for (let i = 0; i < 64; i = i + 1) { hog.push(chunk) } return hog })() }}
diff --git a/smoke-test/verify-memory-limit.sh b/smoke-test/verify-memory-limit.sh
index a6c1cf7c60c..a6319ab597b 100755
--- a/smoke-test/verify-memory-limit.sh
+++ b/smoke-test/verify-memory-limit.sh
@@ -3,8 +3,8 @@ set -euo pipefail
# Verifies that a flow that exhausts the sandbox memory reliably ends with flow run status
# MEMORY_LIMIT_EXCEEDED. Expects a flow created by benchmark/setup.sh with
-# CODE_INPUT_SUM="$(cat benchmark/oom-expression.txt)" on a stack running
-# AP_EXECUTION_MODE=SANDBOX_CODE_ONLY. The expression builds ~50MB inside the 128MB v8
+# CODE_BODY_FILE=benchmark/oom-code.js on a stack running
+# AP_EXECUTION_MODE=SANDBOX_CODE_ONLY. The code step builds ~50MB inside the 128MB v8
# isolate (an array of refs to one big string), and the engine's outRef.copy() then
# materializes every element separately in the ENGINE heap (~3GB) — the engine process dies
# on the sandbox memory limit, which is how code-only engines OOM in production.