From 9343d4cdf4e47ebe84da9d843730542a421db23d Mon Sep 17 00:00:00 2001 From: Satyam Srivastava Date: Sun, 26 Apr 2026 11:18:21 -0700 Subject: [PATCH] [bug] Fix modal remote functions crash container on sys.exit(0) during PR tests --- fastvideo/tests/modal/pr_test.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fastvideo/tests/modal/pr_test.py b/fastvideo/tests/modal/pr_test.py index cc482efe8..6699619b0 100644 --- a/fastvideo/tests/modal/pr_test.py +++ b/fastvideo/tests/modal/pr_test.py @@ -72,13 +72,21 @@ def run_test(pytest_command: str): {pytest_command} """ + # result = subprocess.run(["/bin/bash", "-c", command], + # stdout=sys.stdout, + # stderr=sys.stderr, + # check=False) + + # sys.exit(result.returncode) + result = subprocess.run(["/bin/bash", "-c", command], stdout=sys.stdout, stderr=sys.stderr, check=False) - sys.exit(result.returncode) - + if result.returncode != 0: + raise RuntimeError(f"Test command failed with exit code {result.returncode}") + # On success, just return — don't call sys.exit() @app.function(gpu="H100:1", image=image,