ci: invalidate poisoned shard-timing cache and guard future saves (#36568)

This commit is contained in:
David Krauser
2026-05-14 16:01:49 +00:00
committed by GitHub
parent d1fb57bc37
commit 4aa1c58e37
6 changed files with 83 additions and 16 deletions
+1
View File
@@ -247,6 +247,7 @@ jobs:
artifact-pattern: postgres-server-test-logs-shard-*
artifact-name: postgres-server-test-logs
save-timing-cache: true
all-shards-passed: ${{ needs.test-postgres-normal.result == 'success' }}
test-elasticsearch-v8:
name: Elasticsearch v8 Compatibility
@@ -16,6 +16,11 @@ on:
required: false
type: boolean
default: false
all-shards-passed:
description: "Whether every upstream shard succeeded. Used to gate the timing-cache save so a single shard failure doesn't poison the cache with missing-package data."
required: false
type: boolean
default: false
jobs:
merge:
@@ -79,11 +84,17 @@ jobs:
echo "has_timing=false" >> "$GITHUB_OUTPUT"
fi
# Only save when every upstream shard succeeded. If even one shard
# failed/was killed, its gotestsum.json is missing and the merged report
# has no timings for that shard's packages — saving that would poison
# future shard splits (missing packages default to 1ms, all bin-pack
# onto the lightest shard, overloading it and repeating the failure).
- name: Save test timing cache
if: inputs.save-timing-cache && steps.timing-prep.outputs.has_timing == 'true' && github.ref_name == github.event.repository.default_branch
if: inputs.save-timing-cache && inputs.all-shards-passed && steps.timing-prep.outputs.has_timing == 'true' && github.ref_name == github.event.repository.default_branch
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
server/prev-report.xml
server/prev-gotestsum.json
key: server-test-timing-master-${{ github.run_id }}
# The v2 prefix matches the v2 restore prefix in server-test-template.yml.
key: server-test-timing-v2-master-${{ github.run_id }}
+8 -2
View File
@@ -93,9 +93,15 @@ jobs:
server/prev-gotestsum.json
# Always restore from master — timing is only saved on the default
# branch and is stable enough for shard balancing.
key: server-test-timing-master
# NOTE: the v2 prefix invalidates pre-existing caches that were
# poisoned by shard failures (a killed shard loses its gotestsum.json,
# so the merged report was missing those packages' timings; on the
# next run they all defaulted to 1ms and bin-packed onto the lightest
# shard, overloading it and perpetuating the cycle). See also the
# all-shards-passed guard in server-test-merge-template.yml.
key: server-test-timing-v2-master
restore-keys: |
server-test-timing-
server-test-timing-v2-
- name: Setup BUILD_IMAGE
id: build