Skip to content

Commit 50aceaf

Browse files
Merge branch '1.11.x' into 1.12.x
2 parents c053d35 + 51745d7 commit 50aceaf

File tree

1 file changed

+2
-36
lines changed
  • micrometer-core/src/test/java/io/micrometer/core/instrument

1 file changed

+2
-36
lines changed

micrometer-core/src/test/java/io/micrometer/core/instrument/TagsTest.java

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -338,26 +338,7 @@ void emptyShouldNotContainTags() {
338338
@Issue("#3313")
339339
@DisabledIfSystemProperty(named = "java.vm.name", matches = JAVA_VM_NAME_J9_REGEX,
340340
disabledReason = "Sun ThreadMXBean with allocation counter not available")
341-
@EnabledForJreRange(max = JRE.JAVA_18)
342341
void andEmptyDoesNotAllocate() {
343-
andEmptyDoesNotAllocate(0);
344-
}
345-
346-
// See https://github.com/micrometer-metrics/micrometer/issues/3436
347-
@Test
348-
@Issue("#3313")
349-
@DisabledIfSystemProperty(named = "java.vm.name", matches = JAVA_VM_NAME_J9_REGEX,
350-
disabledReason = "Sun ThreadMXBean with allocation counter not available")
351-
@EnabledIf("java19")
352-
void andEmptyDoesNotAllocateOnJava19() {
353-
andEmptyDoesNotAllocate(16);
354-
}
355-
356-
static boolean java19() {
357-
return "19".equals(System.getProperty("java.version"));
358-
}
359-
360-
private void andEmptyDoesNotAllocate(int expectedAllocatedBytes) {
361342
ThreadMXBean threadMXBean = (ThreadMXBean) ManagementFactory.getThreadMXBean();
362343
long currentThreadId = Thread.currentThread().getId();
363344
Tags tags = Tags.of("a", "b");
@@ -368,29 +349,14 @@ private void andEmptyDoesNotAllocate(int expectedAllocatedBytes) {
368349
long allocatedBytes = threadMXBean.getThreadAllocatedBytes(currentThreadId) - allocatedBytesBefore;
369350

370351
assertThat(combined).isEqualTo(tags);
371-
assertThat(allocatedBytes).isEqualTo(expectedAllocatedBytes);
352+
assertThat(allocatedBytes).isEqualTo(0);
372353
}
373354

374355
@Test
375356
@Issue("#3313")
376357
@DisabledIfSystemProperty(named = "java.vm.name", matches = JAVA_VM_NAME_J9_REGEX,
377358
disabledReason = "Sun ThreadMXBean with allocation counter not available")
378-
@EnabledForJreRange(max = JRE.JAVA_18)
379359
void ofEmptyDoesNotAllocate() {
380-
ofEmptyDoesNotAllocate(0);
381-
}
382-
383-
// See https://github.com/micrometer-metrics/micrometer/issues/3436
384-
@Test
385-
@Issue("#3313")
386-
@DisabledIfSystemProperty(named = "java.vm.name", matches = JAVA_VM_NAME_J9_REGEX,
387-
disabledReason = "Sun ThreadMXBean with allocation counter not available")
388-
@EnabledIf("java19")
389-
void ofEmptyDoesNotAllocateOnJava19() {
390-
ofEmptyDoesNotAllocate(16);
391-
}
392-
393-
private void ofEmptyDoesNotAllocate(int expectedAllocatedBytes) {
394360
ThreadMXBean threadMXBean = (ThreadMXBean) ManagementFactory.getThreadMXBean();
395361
long currentThreadId = Thread.currentThread().getId();
396362
Tags extraTags = Tags.empty();
@@ -400,7 +366,7 @@ private void ofEmptyDoesNotAllocate(int expectedAllocatedBytes) {
400366
long allocatedBytes = threadMXBean.getThreadAllocatedBytes(currentThreadId) - allocatedBytesBefore;
401367

402368
assertThat(of).isEqualTo(Tags.empty());
403-
assertThat(allocatedBytes).isEqualTo(expectedAllocatedBytes);
369+
assertThat(allocatedBytes).isEqualTo(0);
404370
}
405371

406372
private void assertTags(Tags tags, String... keyValues) {

0 commit comments

Comments
 (0)