Skip to content

Commit

Permalink
Upgrade to openjdk 16.0.1 and skip failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
shakuzen committed Jul 16, 2021
1 parent a18fe6a commit ac1afff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ executors:
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
docker:
- image: cimg/openjdk:16.0.0
- image: cimg/openjdk:16.0.1
machine-executor:
working_directory: ~/micrometer
machine:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,19 @@ private void assertThreadPoolExecutorMetrics(String executorName, String metricP
registry.get(metricPrefix + "executor.idle").tags(userTags).tag("name", executorName).timer();
registry.get(metricPrefix + "executor").tags(userTags).tag("name", executorName).timer();
}

@Test
void newSingleThreadScheduledExecutor() {
String executorServiceName = "myExecutorService";
ExecutorServiceMetrics.monitor(registry, Executors.newSingleThreadScheduledExecutor(), executorServiceName);
// timer metrics still available, even on Java 16+
registry.get("executor").tag("name", executorServiceName).timer();
if (isJava16OrLater()) return; // see gh-2317; ExecutorServiceMetrics not available for inaccessible JDK internal types
registry.get("executor.completed").tag("name", executorServiceName).functionCounter();
}

private boolean isJava16OrLater() {
return JRE.currentVersion().compareTo(JRE.JAVA_16) >= 0;
}

}

0 comments on commit ac1afff

Please sign in to comment.