File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
integration-tests/opentelemetry/src/test/java/io/quarkus/it/opentelemetry Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,16 @@ void testAllJvmMetrics() {
104104 .containsAll (allMetrics .stream ().map (MetricToAssert ::name ).toList ());
105105 });
106106
107+ Set <String > flakyMetrics = new HashSet <>();
108+ flakyMetrics .add ("jvm.memory.used_after_last_gc" );
109+ flakyMetrics .add ("jvm.cpu.limit" );
110+ flakyMetrics .add ("jvm.cpu.recent_utilization" );
111+ flakyMetrics .add ("jvm.system.cpu.utilization" );
112+ if (JdkUtil .isSemeru ()) {
113+ // this one has been flaky on CI with Semeru
114+ flakyMetrics .add ("jvm.memory.used" );
115+ }
116+
107117 allMetrics .forEach (metricToAssert -> {
108118
109119 // metric is there and has at least 1 reading
@@ -113,11 +123,7 @@ void testAllJvmMetrics() {
113123 .hasSizeGreaterThan (0 ));
114124
115125 // skip assertions from flaky metrics
116- if (!metricToAssert .name ().equals ("jvm.memory.used_after_last_gc" ) &&
117- !metricToAssert .name ().equals ("jvm.cpu.limit" ) &&
118- !metricToAssert .name ().equals ("jvm.cpu.recent_utilization" ) &&
119- !metricToAssert .name ().equals ("jvm.system.cpu.utilization" )) {
120-
126+ if (!flakyMetrics .contains (metricToAssert .name ())) {
121127 // Correct values might take some time to register
122128 await ().atMost (10 , SECONDS ).untilAsserted (() -> assertThat (getLastReading (metricToAssert ))
123129 .withFailMessage ("Metric must be greater than 0: " + metricToAssert .name )
You can’t perform that action at this time.
0 commit comments