Skip to content

Commit 905b29e

Browse files
committed
temporarily speed up presubmit feedback
1 parent db2e63a commit 905b29e

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

.github/workflows/unittest.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
matrix: ${{ steps.set-matrix.outputs.matrix }}
3030
is_full_run: ${{ steps.check-label.outputs.is_full_run }}
3131
env:
32-
MAX_SHARDS: 16
32+
MAX_SHARDS: 50
3333
# Define weights for long-running unit tests to balance shard execution time
3434
# Each weight is roughly 1 minute of expected execution time
3535
# Default for unset packages is 1
@@ -113,8 +113,7 @@ jobs:
113113
- name: Run unit tests
114114
run: |
115115
uv pip install --system nox nox-uv
116-
# Caches compiled wheels locally to prevent building heavy libraries
117-
# such as grpcio, which we build from scratch on every run for Python 3.15+.
116+
# Caches local wheels for Python 3.15+ to avoid repeatedly downloading or building heavy libraries.
118117
# Follow https://github.com/grpc/grpc/issues/41010 for updates.
119118
- name: Cache Built Python 3.15 Wheels
120119
if: matrix.python == '3.15'
@@ -124,15 +123,20 @@ jobs:
124123
key: ${{ runner.os }}-uv-wheels-3.15-${{ hashFiles('packages/**/testing/constraints*.txt') }}
125124
restore-keys: |
126125
${{ runner.os }}-uv-wheels-3.15-
127-
# Pre-cache heavy dependencies sequentially before running parallel tests
128-
- name: Pre-cache heavy dependencies (grpcio)
126+
# TODO: Remove this step once official Python 3.15 wheels for grpcio are published to PyPI.
127+
# See https://github.com/grpc/grpc/issues/41010#issuecomment-4848264910 for details.
128+
- name: Install grpcio wheel for Python 3.15
129129
if: matrix.python == '3.15'
130130
run: |
131-
# Create the directory so uv doesn't crash if there is a `cache miss`
132131
mkdir -p .uv-wheel-cache
133-
# Download and compile grpcio sequentially so that parallel test workers
134-
# immediately hit the warm cache instead of deadlocking on compilation.
135-
uv pip install --system grpcio --find-links .uv-wheel-cache
132+
WHEEL_FILE=".uv-wheel-cache/grpcio-1.83.0.dev0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl"
133+
if [ ! -f "$WHEEL_FILE" ]; then
134+
curl -L "https://packages.grpc.io/archive/2026/06/5ccdab32010f762634e1082d19be53cf60458456-b37e49c7-5e62-4cbe-870a-c599bb907b04/python/grpcio/grpcio-1.83.0.dev0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl" -o "$WHEEL_FILE"
135+
fi
136+
echo "d7706633cd5d97a8b8d3c6ed36c5940722a9b5cbb47f0d10bc433ee27af36ff0 $WHEEL_FILE" | sha256sum -c
137+
uv pip install --system "$WHEEL_FILE"
138+
echo "UV_FIND_LINKS=${{ github.workspace }}/.uv-wheel-cache" >> $GITHUB_ENV
139+
echo "UV_CACHE_DIR=${{ github.workspace }}/.uv-wheel-cache" >> $GITHUB_ENV
136140
- name: Run unit tests for ${{ matrix.package_shard.description }}
137141
env:
138142
BUILD_TYPE: presubmit

ci/get_package_shards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def group_packages(packages_map):
165165

166166
# Dynamically determine target weight to balance across max shards.
167167
max_shards = int(os.environ.get("MAX_SHARDS", 16))
168-
target_weight = max(10, math.ceil(total_weight / max_shards))
168+
target_weight = max(5, math.ceil(total_weight / max_shards))
169169

170170
shards_list = []
171171
current_shard_items = []

0 commit comments

Comments
 (0)