Skip to content

Commit 710099e

Browse files
chore: Fix AFE metric in cloud-staging (googleapis#4202)
* chore: Fix AFE metric in cloud-staging * chore: generate libraries at Mon Nov 10 10:37:33 UTC 2025 --------- Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
1 parent ca43348 commit 710099e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 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,8 @@ public void testBuiltinMetricsWithDefaultOTEL() throws Exception {
151151
}
152152
}
153153

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

0 commit comments

Comments
 (0)