Skip to content

Commit 167f154

Browse files
mircea-cosbucfealebenpae
authored andcommitted
CLOUDP-300239: Skip unit-tests variant with retry script in EVG (#4138)
# Summary This patch skips retrying failed tasks in the `unit_tests` variant ## Proof of Work Failing unit tests patch without retries: https://spruce.mongodb.com/version/67c0a9e89493f200075f06aa ## Checklist - [x] Have you linked a jira ticket and/or is the ticket in the title? - [x] Have you checked whether your jira ticket required DOCSP changes? - [x] Have you checked for release_note changes? ## Reminder (Please remove this when merging) - Please try to Approve or Reject Changes the PR, keep PRs in review as short as possible - Our Short Guide for PRs: [Link](https://docs.google.com/document/d/1T93KUtdvONq43vfTfUt8l92uo4e4SEEvFbIEKOxGr44/edit?tab=t.0) - Remember the following Communication Standards - use comment prefixes for clarity: * **blocking**: Must be addressed before approval. * **follow-up**: Can be addressed in a later PR or ticket. * **q**: Clarifying question. * **nit**: Non-blocking suggestions. * **note**: Side-note, non-actionable. Example: Praise * --> no prefix is considered a question
1 parent 88d888d commit 167f154

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

controllers/om/automation_status.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"maps"
77
"slices"
8+
"sort"
89

910
"go.uber.org/zap"
1011
"golang.org/x/xerrors"
@@ -100,6 +101,7 @@ func checkAutomationStatusIsGoal(as *AutomationStatus, relevantProcesses []strin
100101
goalsNotAchievedMsgList = append(goalsNotAchievedMsgList, fmt.Sprintf("%s@%d", processName, goalAchieved))
101102
}
102103
goalsAchievedMsgList := slices.Collect(maps.Keys(goalsAchievedMap))
104+
sort.Strings(goalsAchievedMsgList)
103105

104106
if len(goalsNotAchievedMap) > 0 {
105107
return false, fmt.Sprintf("%d processes waiting to reach automation config goal state (version=%d): %s, %d processes reached goal state: %s",

controllers/om/automation_status_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestCheckAutomationStatusIsGoal(t *testing.T) {
4040
},
4141
expectedResult: true,
4242
// We can not check for the full message as the ordering of the processes won't be deterministic (stored in a map)
43-
expectedMsg: "processes that reached goal state:",
43+
expectedMsg: "processes that reached goal state: [a b]",
4444
}, {
4545
name: "one not in goal state",
4646
args: args{

scripts/evergreen/retry-evergreen.sh

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,26 @@ if [[ "${EVERGREEN_RETRY:-"true"}" != "true" ]]; then
1919
exit 0
2020
fi
2121

22-
if [ $# -eq 0 ]
23-
then
24-
echo "Details URL not passed in, exiting..."
25-
exit 1
22+
if [ $# -eq 0 ]; then
23+
echo "Details URL not passed in, exiting..."
24+
exit 1
2625
else
2726
VERSION=$1
2827
fi
29-
if [ -z "${EVERGREEN_USER}" ]
30-
then
31-
echo "$$EVERGREEN_USER not set"
32-
exit 1
28+
if [ -z "${EVERGREEN_USER}" ]; then
29+
echo "$$EVERGREEN_USER not set"
30+
exit 1
3331
fi
34-
if [ -z "${EVERGREEN_API_KEY}" ]
35-
then
36-
echo "$$EVERGREEN_API_KEY not set"
37-
exit 1
32+
if [ -z "${EVERGREEN_API_KEY}" ]; then
33+
echo "$$EVERGREEN_API_KEY not set"
34+
exit 1
3835
fi
3936

4037
EVERGREEN_API="https://evergreen.mongodb.com/api"
4138
MAX_RETRIES="${EVERGREEN_MAX_RETRIES:-3}"
4239

4340
# shellcheck disable=SC2207
44-
BUILD_IDS=($(curl -s -H "Api-User: ${EVERGREEN_USER}" -H "Api-Key: ${EVERGREEN_API_KEY}" ${EVERGREEN_API}/rest/v2/versions/"${VERSION}" | jq -r '.build_variants_status[] | .build_id'))
41+
BUILD_IDS=($(curl -s -H "Api-User: ${EVERGREEN_USER}" -H "Api-Key: ${EVERGREEN_API_KEY}" ${EVERGREEN_API}/rest/v2/versions/"${VERSION}" | jq -r '.build_variants_status[] | select(.build_variant!="unit_tests") | .build_id'))
4542

4643
for BUILD_ID in "${BUILD_IDS[@]}"; do
4744
echo "Finding failed tasks in BUILD ID: ${BUILD_ID}"

0 commit comments

Comments
 (0)