From 61c677010675d74f069342160d2987833e621db1 Mon Sep 17 00:00:00 2001 From: Savio <72797635+Savio-Sou@users.noreply.github.com> Date: Thu, 7 May 2026 15:57:37 -0400 Subject: [PATCH 1/3] Fix port racing condition --- scripts/run.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index 9203815..9535ac0 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,7 +1,16 @@ #!/usr/bin/env bash set -eu -export PORT=8095 +export PORT="${PORT:-8095}" +TS_SERVER_PID="" + +cleanup() { + if [[ -n "$TS_SERVER_PID" ]]; then + kill "$TS_SERVER_PID" 2>/dev/null || true + wait "$TS_SERVER_PID" 2>/dev/null || true + fi +} +trap cleanup EXIT # Build TypeScript first echo "Building TypeScript..." @@ -9,13 +18,17 @@ yarn build # Start TypeScript RPC server in background echo "Starting TypeScript RPC server..." -yarn start & +node dist/oracle_server.js & TS_SERVER_PID=$! -trap 'kill $TS_SERVER_PID 2>/dev/null || true' EXIT # Wait for server to start sleep 2 +if ! kill -0 "$TS_SERVER_PID" 2>/dev/null; then + echo "TypeScript RPC server failed to start" >&2 + exit 1 +fi + project_dir="$(dirname "$0")/.." # Run the Noir tests with oracle resolver From f14068d73fa1076894d629a0c20f2b4a586fd851 Mon Sep 17 00:00:00 2001 From: Savio <72797635+Savio-Sou@users.noreply.github.com> Date: Thu, 7 May 2026 16:29:07 -0400 Subject: [PATCH 2/3] Fix CI error (define full path) --- scripts/run.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index 9535ac0..5debf6b 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -3,6 +3,7 @@ set -eu export PORT="${PORT:-8095}" TS_SERVER_PID="" +project_dir="$(cd "$(dirname "$0")/.." && pwd)" cleanup() { if [[ -n "$TS_SERVER_PID" ]]; then @@ -14,11 +15,11 @@ trap cleanup EXIT # Build TypeScript first echo "Building TypeScript..." -yarn build +yarn --cwd "$project_dir" build # Start TypeScript RPC server in background echo "Starting TypeScript RPC server..." -node dist/oracle_server.js & +node "$project_dir/dist/oracle_server.js" & TS_SERVER_PID=$! # Wait for server to start @@ -29,7 +30,5 @@ if ! kill -0 "$TS_SERVER_PID" 2>/dev/null; then exit 1 fi -project_dir="$(dirname "$0")/.." - # Run the Noir tests with oracle resolver nargo --program-dir="$project_dir" test --oracle-resolver http://localhost:${PORT} From bde183cb593145dbc297a2491057983756a0e043 Mon Sep 17 00:00:00 2001 From: Savio <72797635+Savio-Sou@users.noreply.github.com> Date: Thu, 7 May 2026 16:33:00 -0400 Subject: [PATCH 3/3] Revert unnecessary yarn build path --- scripts/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run.sh b/scripts/run.sh index 5debf6b..bcd6284 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -15,7 +15,7 @@ trap cleanup EXIT # Build TypeScript first echo "Building TypeScript..." -yarn --cwd "$project_dir" build +yarn build # Start TypeScript RPC server in background echo "Starting TypeScript RPC server..."