mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix timeout check workflow lint job (#142476)
Fixes https://github.com/pytorch/pytorch/issues/142485 The workflow check lint job timed out in trunk, i.e. https://github.com/pytorch/pytorch/actions/runs/12261226178/job/34207762939, and here was what happened: 1. https://github.com/pytorch/pytorch/pull/142294 landed yesterday to build ROCm on 3.13, but the PR had a landrace with https://github.com/pytorch/pytorch/pull/142282 in the generated workflow file 2. The trunk lint check caught that in https://github.com/pytorch/pytorch/blob/main/.github/scripts/report_git_status.sh#L2 3. However, the script also attempted to print the difference with `git diff .github/workflows`. This command was the one that stuck because `git diff` uses page by default and requires a prompt to display the next page ¯\_(ツ)_/¯ It took so long to debug this because a timeout Nova GHA doesn't print any progress. I'll create an issue for this. Bonus: I also fix the broken print from test tool lint job that confuses GitHub https://github.com/pytorch/pytorch/actions/runs/12261226178 with an annotation failure `Credentials could not be loaded, please check your action inputs` Pull Request resolved: https://github.com/pytorch/pytorch/pull/142476 Approved by: https://github.com/wdvr
This commit is contained in:
6
.github/scripts/report_git_status.sh
vendored
6
.github/scripts/report_git_status.sh
vendored
@ -1,5 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
|
||||
CHANGES=$(git status --porcelain "$1")
|
||||
echo "$CHANGES"
|
||||
git diff "$1"
|
||||
# NB: Use --no-pager here to avoid git diff asking for a prompt to continue
|
||||
git --no-pager diff "$1"
|
||||
[ -z "$CHANGES" ]
|
||||
|
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@ -207,8 +207,8 @@ jobs:
|
||||
conda activate "${CONDA_ENV}"
|
||||
|
||||
# Test tools
|
||||
python3 -m unittest discover -vs tools/test -p 'test_*.py'
|
||||
python3 -m unittest discover -vs .github/scripts -p 'test_*.py'
|
||||
PYTHONPATH=$(pwd) pytest tools/test/test_*.py
|
||||
PYTHONPATH=$(pwd) pytest .github/scripts/test_*.py
|
||||
|
||||
test_run_test:
|
||||
name: Test `run_test.py` is usable without boto3
|
||||
|
Reference in New Issue
Block a user