Class VirtualThreadExecutorMetricsTest

java.lang.Object
ubic.gemma.core.metrics.binder.VirtualThreadExecutorMetricsTest

public class VirtualThreadExecutorMetricsTest extends Object
Verifies that VirtualThreadExecutorMetrics correctly increments its counters/gauges when wrapped tasks are submitted, complete, or throw. Uses a cached thread pool as the delegate (not the VT executor itself) so the test runs identically on JDK 17 and 21 — the wrapper's instrumentation is independent of the underlying ExecutorService implementation.
  • Constructor Details

    • VirtualThreadExecutorMetricsTest

      public VirtualThreadExecutorMetricsTest()
  • Method Details

    • setUp

      @BeforeEach public void setUp()
    • tearDown

      @AfterEach public void tearDown() throws InterruptedException
      Throws:
      InterruptedException
    • submitRunnable_incrementsSubmittedAndCompleted

      @Test public void submitRunnable_incrementsSubmittedAndCompleted() throws Exception
      Throws:
      Exception
    • executeRunnableThatThrows_incrementsFailed

      @Test public void executeRunnableThatThrows_incrementsFailed() throws Exception
      Throws:
      Exception
    • submitCallableThatThrows_incrementsFailed

      @Test public void submitCallableThatThrows_incrementsFailed()
    • activeGauge_tracksInFlightTasks

      @Test public void activeGauge_tracksInFlightTasks() throws Exception
      Throws:
      Exception
    • tagsArePresentOnAllMeters

      @Test public void tagsArePresentOnAllMeters()