@@ -338,26 +338,7 @@ void emptyShouldNotContainTags() {
338
338
@ Issue ("#3313" )
339
339
@ DisabledIfSystemProperty (named = "java.vm.name" , matches = JAVA_VM_NAME_J9_REGEX ,
340
340
disabledReason = "Sun ThreadMXBean with allocation counter not available" )
341
- @ EnabledForJreRange (max = JRE .JAVA_18 )
342
341
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 ) {
361
342
ThreadMXBean threadMXBean = (ThreadMXBean ) ManagementFactory .getThreadMXBean ();
362
343
long currentThreadId = Thread .currentThread ().getId ();
363
344
Tags tags = Tags .of ("a" , "b" );
@@ -368,29 +349,14 @@ private void andEmptyDoesNotAllocate(int expectedAllocatedBytes) {
368
349
long allocatedBytes = threadMXBean .getThreadAllocatedBytes (currentThreadId ) - allocatedBytesBefore ;
369
350
370
351
assertThat (combined ).isEqualTo (tags );
371
- assertThat (allocatedBytes ).isEqualTo (expectedAllocatedBytes );
352
+ assertThat (allocatedBytes ).isEqualTo (0 );
372
353
}
373
354
374
355
@ Test
375
356
@ Issue ("#3313" )
376
357
@ DisabledIfSystemProperty (named = "java.vm.name" , matches = JAVA_VM_NAME_J9_REGEX ,
377
358
disabledReason = "Sun ThreadMXBean with allocation counter not available" )
378
- @ EnabledForJreRange (max = JRE .JAVA_18 )
379
359
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 ) {
394
360
ThreadMXBean threadMXBean = (ThreadMXBean ) ManagementFactory .getThreadMXBean ();
395
361
long currentThreadId = Thread .currentThread ().getId ();
396
362
Tags extraTags = Tags .empty ();
@@ -400,7 +366,7 @@ private void ofEmptyDoesNotAllocate(int expectedAllocatedBytes) {
400
366
long allocatedBytes = threadMXBean .getThreadAllocatedBytes (currentThreadId ) - allocatedBytesBefore ;
401
367
402
368
assertThat (of ).isEqualTo (Tags .empty ());
403
- assertThat (allocatedBytes ).isEqualTo (expectedAllocatedBytes );
369
+ assertThat (allocatedBytes ).isEqualTo (0 );
404
370
}
405
371
406
372
private void assertTags (Tags tags , String ... keyValues ) {
0 commit comments