Exit once there's an environment error (#71693)

Summary:
Narrow the scope of https://github.com/pytorch/pytorch/issues/69730.
Once there's an error, stop the script.
Since it's a random error, it most likely has something with the environment.

Let's see the stat.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71693

Reviewed By: seemethere, mikaylagawarecki

Differential Revision: D33742733

Pulled By: janeyx99

fbshipit-source-id: b453957c2cb450eb79b89614db426b50eef1d14f
This commit is contained in:
Yi Zhang 2022-01-24 10:40:59 -08:00 committed by Facebook GitHub Bot
parent af9d9a4f98
commit cd32fa53d9
3 changed files with 19 additions and 0 deletions

View File

@ -1,4 +1,11 @@
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
:: exit the batch once there's an error
if not errorlevel 0 (
echo "setup pytorch env failed"
echo %errorlevel%
exit /b
)
pushd test pushd test
if "%RUN_SMOKE_TESTS_ONLY%"=="1" ( if "%RUN_SMOKE_TESTS_ONLY%"=="1" (
:: Download specified test cases to run :: Download specified test cases to run

View File

@ -1,4 +1,10 @@
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
:: exit the batch once there's an error
if not errorlevel 0 (
echo "setup pytorch env failed"
echo %errorlevel%
exit /b
)
pushd test pushd test

View File

@ -1,4 +1,10 @@
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
:: exit the batch once there's an error
if not errorlevel 0 (
echo "setup pytorch env failed"
echo %errorlevel%
exit /b
)
echo Copying over test times file echo Copying over test times file
copy /Y "%PYTORCH_FINAL_PACKAGE_DIR_WIN%\.pytorch-test-times.json" "%TEST_DIR_WIN%" copy /Y "%PYTORCH_FINAL_PACKAGE_DIR_WIN%\.pytorch-test-times.json" "%TEST_DIR_WIN%"