@@ -329,26 +329,7 @@ void emptyShouldNotContainTags() {
329
329
@ Issue ("#3313" )
330
330
@ DisabledIfSystemProperty (named = "java.vm.name" , matches = JAVA_VM_NAME_J9_REGEX ,
331
331
disabledReason = "Sun ThreadMXBean with allocation counter not available" )
332
- @ EnabledForJreRange (max = JRE .JAVA_18 )
333
332
void andEmptyDoesNotAllocate () {
334
- andEmptyDoesNotAllocate (0 );
335
- }
336
-
337
- // See https://github.com/micrometer-metrics/micrometer/issues/3436
338
- @ Test
339
- @ Issue ("#3313" )
340
- @ DisabledIfSystemProperty (named = "java.vm.name" , matches = JAVA_VM_NAME_J9_REGEX ,
341
- disabledReason = "Sun ThreadMXBean with allocation counter not available" )
342
- @ EnabledIf ("java19" )
343
- void andEmptyDoesNotAllocateOnJava19 () {
344
- andEmptyDoesNotAllocate (16 );
345
- }
346
-
347
- static boolean java19 () {
348
- return "19" .equals (System .getProperty ("java.version" ));
349
- }
350
-
351
- private void andEmptyDoesNotAllocate (int expectedAllocatedBytes ) {
352
333
ThreadMXBean threadMXBean = (ThreadMXBean ) ManagementFactory .getThreadMXBean ();
353
334
long currentThreadId = Thread .currentThread ().getId ();
354
335
Tags tags = Tags .of ("a" , "b" );
@@ -359,29 +340,14 @@ private void andEmptyDoesNotAllocate(int expectedAllocatedBytes) {
359
340
long allocatedBytes = threadMXBean .getThreadAllocatedBytes (currentThreadId ) - allocatedBytesBefore ;
360
341
361
342
assertThat (combined ).isEqualTo (tags );
362
- assertThat (allocatedBytes ).isEqualTo (expectedAllocatedBytes );
343
+ assertThat (allocatedBytes ).isEqualTo (0 );
363
344
}
364
345
365
346
@ Test
366
347
@ Issue ("#3313" )
367
348
@ DisabledIfSystemProperty (named = "java.vm.name" , matches = JAVA_VM_NAME_J9_REGEX ,
368
349
disabledReason = "Sun ThreadMXBean with allocation counter not available" )
369
- @ EnabledForJreRange (max = JRE .JAVA_18 )
370
350
void ofEmptyDoesNotAllocate () {
371
- ofEmptyDoesNotAllocate (0 );
372
- }
373
-
374
- // See https://github.com/micrometer-metrics/micrometer/issues/3436
375
- @ Test
376
- @ Issue ("#3313" )
377
- @ DisabledIfSystemProperty (named = "java.vm.name" , matches = JAVA_VM_NAME_J9_REGEX ,
378
- disabledReason = "Sun ThreadMXBean with allocation counter not available" )
379
- @ EnabledIf ("java19" )
380
- void ofEmptyDoesNotAllocateOnJava19 () {
381
- ofEmptyDoesNotAllocate (16 );
382
- }
383
-
384
- private void ofEmptyDoesNotAllocate (int expectedAllocatedBytes ) {
385
351
ThreadMXBean threadMXBean = (ThreadMXBean ) ManagementFactory .getThreadMXBean ();
386
352
long currentThreadId = Thread .currentThread ().getId ();
387
353
Tags extraTags = Tags .empty ();
@@ -391,7 +357,7 @@ private void ofEmptyDoesNotAllocate(int expectedAllocatedBytes) {
391
357
long allocatedBytes = threadMXBean .getThreadAllocatedBytes (currentThreadId ) - allocatedBytesBefore ;
392
358
393
359
assertThat (of ).isEqualTo (Tags .empty ());
394
- assertThat (allocatedBytes ).isEqualTo (expectedAllocatedBytes );
360
+ assertThat (allocatedBytes ).isEqualTo (0 );
395
361
}
396
362
397
363
private void assertTags (Tags tags , String ... keyValues ) {
0 commit comments