Skip to content

Commit f762e8f

Browse files
chore: Fix AFE metric in cloud-staging
1 parent ca43348 commit f762e8f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBuiltInMetricsTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ public void testBuiltinMetricsWithDefaultOTEL() throws Exception {
137137
IntegerSubject subject =
138138
assertWithMessage("Metric " + metric + " returned data.")
139139
.that(response.getTimeSeriesCount());
140-
if (isProduction()) {
141-
subject.isEqualTo(0);
142-
} else {
140+
if (isAfeMetricEnabled()) {
143141
subject.isGreaterThan(0);
142+
} else {
143+
subject.isEqualTo(0);
144144
}
145145

146146
} else {
@@ -151,9 +151,9 @@ public void testBuiltinMetricsWithDefaultOTEL() throws Exception {
151151
}
152152
}
153153

154-
private boolean isProduction() {
154+
private boolean isAfeMetricEnabled() {
155155
String jobType = System.getenv("JOB_TYPE");
156156
return !Strings.isNullOrEmpty(jobType)
157-
&& !(jobType.contains("devel") || jobType.contains("staging"));
157+
&& jobType.contains("devel");
158158
}
159159
}

0 commit comments

Comments
 (0)