Skip to content

Commit 24031fa

Browse files
committed
Drop all disruption/alert matcher fallbacks except previous release
These turned out to be failing 100% of the time and doing all kinds of things we wouldn't expect. If we don't have the data, we won't run the test.
1 parent 3331f1b commit 24031fa

File tree

3 files changed

+3
-206
lines changed

3 files changed

+3
-206
lines changed

pkg/monitortestlibrary/allowedalerts/matches_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,6 @@ func TestGetClosestP99Value(t *testing.T) {
106106
},
107107
expectedDuration: mustDuration("7.9s"),
108108
},
109-
{
110-
name: "choose different arch",
111-
key: historicaldata.AlertDataKey{
112-
AlertName: "etcdGRPCRequestsSlow",
113-
AlertNamespace: "",
114-
AlertLevel: "warning",
115-
JobType: platformidentification.JobType{
116-
Release: "4.12",
117-
FromRelease: "4.12",
118-
Platform: "aws",
119-
Architecture: "not-real",
120-
Network: "sdn",
121-
Topology: "ha",
122-
},
123-
},
124-
expectedDuration: mustDuration("120.458s"),
125-
},
126109
{
127110
name: "missing",
128111
key: historicaldata.AlertDataKey{

pkg/monitortestlibrary/allowedbackenddisruption/matches_test.go

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -152,53 +152,6 @@ func TestGetClosestP95Value(t *testing.T) {
152152
},
153153
expectedDuration: mustDuration("2.987s"),
154154
},
155-
{
156-
name: "fuzzy match single ovn fallback to sdn",
157-
args: args{
158-
backendName: "kube-api-new-connections",
159-
jobType: platformidentification.JobType{
160-
Release: "4.12",
161-
FromRelease: "4.12",
162-
Platform: "aws",
163-
Architecture: "amd64",
164-
Network: "ovn", // we only defined sdn above, should fall back to it's value
165-
Topology: "single",
166-
},
167-
},
168-
expectedDuration: mustDuration("120.458s"),
169-
},
170-
{
171-
name: "fuzzy match single ovn fallback to sdn previous",
172-
args: args{
173-
// switching to openshift-api backend, defined above we only have from 4.11->4.11 and sdn
174-
backendName: "openshift-api-new-connections",
175-
jobType: platformidentification.JobType{
176-
Release: "4.12",
177-
FromRelease: "4.12",
178-
Platform: "aws",
179-
Network: "ovn",
180-
Architecture: "amd64",
181-
Topology: "single",
182-
},
183-
},
184-
expectedDuration: mustDuration("70.381s"),
185-
},
186-
{
187-
name: "fuzzy match single ovn fallback to sdn previous micro",
188-
args: args{
189-
// For oauth backend ovn single don't have 4.12 minor, but we have 4.11->4.12 sdn above:
190-
backendName: "oauth-api-new-connections",
191-
jobType: platformidentification.JobType{
192-
Release: "4.12",
193-
FromRelease: "4.11",
194-
Platform: "aws",
195-
Network: "ovn",
196-
Architecture: "amd64",
197-
Topology: "single",
198-
},
199-
},
200-
expectedDuration: mustDuration("35.917s"),
201-
},
202155
{
203156
name: "no exact or fuzzy match",
204157
args: args{

pkg/monitortestlibrary/historicaldata/next_best_guess.go

Lines changed: 3 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -10,95 +10,18 @@ import (
1010
)
1111

1212
// nextBestGuessers is the order in which to attempt to lookup other alternative matches that are close to this job type.
13-
// TODO building a cross multiply would likely be beneficial
1413
var nextBestGuessers = []NextBestKey{
15-
MicroReleaseUpgrade,
16-
// MinorReleaseUpgrade,
14+
// The only guesser we try not is falling back to previous release. Otherwise if we don't have enough data, we don't
15+
// run the test. This was implemented after finding that we fail every attempt at a fallback.
16+
// Continuing with previous release helps us in the transition between major releases, so we kept this fallback.
1717
PreviousReleaseUpgrade,
18-
19-
combine(PreviousReleaseUpgrade, MicroReleaseUpgrade),
20-
// combine(PreviousReleaseUpgrade, MinorReleaseUpgrade),
21-
22-
OnArchitecture("amd64"),
23-
OnArchitecture("ppc64le"),
24-
OnArchitecture("s390x"),
25-
OnArchitecture("arm64"),
26-
27-
combine(OnArchitecture("amd64"), MicroReleaseUpgrade),
28-
combine(OnArchitecture("ppc64le"), MicroReleaseUpgrade),
29-
combine(OnArchitecture("s390x"), MicroReleaseUpgrade),
30-
combine(OnArchitecture("arm64"), MicroReleaseUpgrade),
31-
32-
// combine(OnArchitecture("amd64"), MinorReleaseUpgrade),
33-
// combine(OnArchitecture("ppc64le"), MinorReleaseUpgrade),
34-
// combine(OnArchitecture("s390x"), MinorReleaseUpgrade),
35-
// combine(OnArchitecture("arm64"), MinorReleaseUpgrade),
36-
37-
combine(OnArchitecture("amd64"), PreviousReleaseUpgrade),
38-
combine(OnArchitecture("ppc64le"), PreviousReleaseUpgrade),
39-
combine(OnArchitecture("s390x"), PreviousReleaseUpgrade),
40-
combine(OnArchitecture("arm64"), PreviousReleaseUpgrade),
41-
42-
combine(OnArchitecture("amd64"), PreviousReleaseUpgrade, MicroReleaseUpgrade),
43-
combine(OnArchitecture("ppc64le"), PreviousReleaseUpgrade, MicroReleaseUpgrade),
44-
combine(OnArchitecture("s390x"), PreviousReleaseUpgrade, MicroReleaseUpgrade),
45-
combine(OnArchitecture("arm64"), PreviousReleaseUpgrade, MicroReleaseUpgrade),
46-
47-
// combine(OnArchitecture("amd64"), PreviousReleaseUpgrade, MinorReleaseUpgrade),
48-
// combine(OnArchitecture("ppc64le"), PreviousReleaseUpgrade, MinorReleaseUpgrade),
49-
// combine(OnArchitecture("s390x"), PreviousReleaseUpgrade, MinorReleaseUpgrade),
50-
// combine(OnArchitecture("arm64"), PreviousReleaseUpgrade, MinorReleaseUpgrade),
51-
52-
combine(ForTopology("single"), OnSDN),
53-
combine(ForTopology("single"), OnSDN, PreviousReleaseUpgrade),
54-
combine(ForTopology("single"), OnSDN, PreviousReleaseUpgrade, MicroReleaseUpgrade),
5518
}
5619

5720
// NextBestKey returns the next best key in the query_results.json generated from BigQuery and a bool indicating whether this guesser has an opinion.
5821
// If the bool is false, the key should not be used.
5922
// Returning true doesn't mean the key exists, it just means that the key is worth trying.
6023
type NextBestKey func(in platformidentification.JobType) (platformidentification.JobType, bool)
6124

62-
// MinorReleaseUpgrade if we don't have data for the current fromRelease and it's a micro upgrade, perhaps we have data
63-
// for a minor upgrade. A 4.11 to 4.11 upgrade will attempt a 4.10 to 4.11 upgrade.
64-
func MinorReleaseUpgrade(in platformidentification.JobType) (platformidentification.JobType, bool) {
65-
if len(in.FromRelease) == 0 {
66-
return platformidentification.JobType{}, false
67-
}
68-
69-
fromReleaseMinor := getMinor(in.FromRelease)
70-
toReleaseMajor := getMajor(in.Release)
71-
toReleaseMinor := getMinor(in.Release)
72-
// if we're already a minor upgrade, this doesn't apply
73-
if fromReleaseMinor == (toReleaseMinor - 1) {
74-
return platformidentification.JobType{}, false
75-
}
76-
77-
ret := platformidentification.CloneJobType(in)
78-
ret.FromRelease = fmt.Sprintf("%d.%d", toReleaseMajor, toReleaseMinor-1)
79-
return ret, true
80-
}
81-
82-
// MicroReleaseUpgrade if we don't have data for the current fromRelease and it's a minor upgrade, perhaps we have data
83-
// for a micro upgrade. A 4.10 to 4.11 upgrade will attempt a 4.11 to 4.11 upgrade.
84-
func MicroReleaseUpgrade(in platformidentification.JobType) (platformidentification.JobType, bool) {
85-
if len(in.FromRelease) == 0 {
86-
return platformidentification.JobType{}, false
87-
}
88-
89-
fromReleaseMinor := getMinor(in.FromRelease)
90-
toReleaseMajor := getMajor(in.Release)
91-
toReleaseMinor := getMinor(in.Release)
92-
// if we're already a micro upgrade, this doesn't apply
93-
if fromReleaseMinor == toReleaseMinor {
94-
return platformidentification.JobType{}, false
95-
}
96-
97-
ret := platformidentification.CloneJobType(in)
98-
ret.FromRelease = fmt.Sprintf("%d.%d", toReleaseMajor, toReleaseMinor)
99-
return ret, true
100-
}
101-
10225
// PreviousReleaseUpgrade if we don't have data for the current toRelease, perhaps we have data for the congruent test
10326
// on the prior release. A 4.11 to 4.11 upgrade will attempt a 4.10 to 4.10 upgrade. A 4.11 no upgrade, will attempt a 4.10 no upgrade.
10427
func PreviousReleaseUpgrade(in platformidentification.JobType) (platformidentification.JobType, bool) {
@@ -130,68 +53,6 @@ func getMinor(in string) int {
13053
return int(minor)
13154
}
13255

133-
// OnOVN maybe we have data on OVN
134-
func OnOVN(in platformidentification.JobType) (platformidentification.JobType, bool) {
135-
if in.Network == "ovn" {
136-
return platformidentification.JobType{}, false
137-
}
138-
139-
ret := platformidentification.CloneJobType(in)
140-
ret.Network = "ovn"
141-
return ret, true
142-
}
143-
144-
// OnSDN maybe we have data on SDN
145-
func OnSDN(in platformidentification.JobType) (platformidentification.JobType, bool) {
146-
if in.Network == "sdn" {
147-
return platformidentification.JobType{}, false
148-
}
149-
150-
ret := platformidentification.CloneJobType(in)
151-
ret.Network = "sdn"
152-
return ret, true
153-
}
154-
155-
// OnArchitecture maybe we match a different architecture
156-
func OnArchitecture(architecture string) func(in platformidentification.JobType) (platformidentification.JobType, bool) {
157-
return func(in platformidentification.JobType) (platformidentification.JobType, bool) {
158-
if in.Architecture == architecture {
159-
return platformidentification.JobType{}, false
160-
}
161-
162-
ret := platformidentification.CloneJobType(in)
163-
ret.Architecture = architecture
164-
return ret, true
165-
}
166-
}
167-
168-
// ForTopology we match on exact topology
169-
func ForTopology(topology string) func(in platformidentification.JobType) (platformidentification.JobType, bool) {
170-
return func(in platformidentification.JobType) (platformidentification.JobType, bool) {
171-
if in.Topology != topology {
172-
return platformidentification.JobType{}, false
173-
}
174-
return in, true
175-
}
176-
}
177-
178-
// combine will start with the input and call each guess in order. It uses the output of the previous NextBestKeyFn
179-
// as the input to the next. This allows combinations like "previous release upgrade micro" without writing custom
180-
// functions for each.
181-
func combine(nextBestKeys ...NextBestKey) NextBestKey {
182-
return func(in platformidentification.JobType) (platformidentification.JobType, bool) {
183-
curr := in
184-
for _, nextBestKey := range nextBestKeys {
185-
var ok bool
186-
curr, ok = nextBestKey(curr)
187-
if !ok {
188-
return curr, false
189-
}
190-
}
191-
return curr, true
192-
}
193-
}
194-
19556
func CurrentReleaseFromMap(releasesInQueryResults map[string]bool) string {
19657
var releaseSlice []struct {
19758
Key string

0 commit comments

Comments
 (0)