Skip to content

Commit 8703a6a

Browse files
committed
split CI
Pull Request resolved: #1429 ghstack-source-id: 314035861 @exported-using-ghexport Differential Revision: [D83884590](https://our.internmc.facebook.com/intern/diff/D83884590/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D83884590/)!
1 parent e5ca0a9 commit 8703a6a

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

.github/workflows/test-gpu-python.yml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,49 @@ jobs:
5252
# pyre currently does not check these assertions
5353
pyright python/tests/test_python_actors.py
5454
55-
# Run GPU Python tests
56-
LC_ALL=C pytest python/tests/ -s -v -m "not oss_skip"
55+
# Run GPU Python tests split into 10 groups sequentially
56+
# Each group runs separately with process cleanup in between
57+
pip install pytest-split
58+
FAILED_GROUPS=()
59+
60+
for GROUP in {1..10}; do
61+
echo "Running test group $GROUP of 10..."
62+
63+
# Kill any existing Python processes to ensure clean state
64+
echo "Cleaning up Python processes before group $GROUP..."
65+
pkill -9 python || true
66+
pkill -9 pytest || true
67+
68+
# Wait a moment for processes to terminate
69+
sleep 2
70+
71+
# Run tests for this group
72+
if LC_ALL=C pytest python/tests/ -s -v -m "not oss_skip" \
73+
--ignore-glob="**/meta/**" \
74+
--dist=no \
75+
--group=$GROUP \
76+
--splits=10; then
77+
echo "✓ Test group $GROUP completed successfully"
78+
else
79+
FAILED_GROUPS+=($GROUP)
80+
echo "✗ Test group $GROUP failed with exit code $?"
81+
fi
82+
83+
done
84+
85+
# Final cleanup after all groups
86+
echo "Final cleanup of Python processes..."
87+
pkill -9 python || true
88+
pkill -9 pytest || true
89+
90+
# Check if any groups failed and exit with appropriate code
91+
if [ ${#FAILED_GROUPS[@]} -eq 0 ]; then
92+
echo "✓ All test groups completed successfully!"
93+
else
94+
echo "✗ The following test groups failed: ${FAILED_GROUPS[*]}"
95+
echo "Failed groups count: ${#FAILED_GROUPS[@]}/10"
96+
exit 1
97+
fi
5798
# TODO(meriksen): temporarily disabled to unblock lands while debugging
5899
# mock CUDA issues on the OSS setup
59100
# python python/tests/test_mock_cuda.py

0 commit comments

Comments
 (0)