mirror of
https://github.com/mattermost/mattermost.git
synced 2026-08-27 05:37:15 -05:00
ci: invalidate poisoned shard-timing cache and guard future saves (#36568)
This commit is contained in:
@@ -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 }}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user