quick-perf / quickperf

QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties
https://github.com/quick-perf/doc/wiki/QuickPerf
Apache License 2.0
465 stars 67 forks source link

Unexpected exception: /tmp/QuickPerf-7265351587637478002/allocation.ser (No such file or directory) #218

Open ennishol opened 4 months ago

ennishol commented 4 months ago

Hello I've tried a simple quarkus 3.8.2 demo application and got the error:

Stack trace
java.lang.IllegalStateException: java.io.FileNotFoundException: /tmp/QuickPerf-7265351587637478002/allocation.ser (No such file or directory)
    at org.quickperf.repository.ObjectInputStreamBuilder.buildFileInputStream(ObjectInputStreamBuilder.java:46)
    at org.quickperf.repository.ObjectInputStreamBuilder.buildObjectInputStream(ObjectInputStreamBuilder.java:28)
    at org.quickperf.repository.LongFileRepository.retrieveLongValueFromFile(LongFileRepository.java:42)
    at org.quickperf.repository.LongFileRepository.find(LongFileRepository.java:37)
    at org.quickperf.jvm.allocation.AllocationRepository.findAllocation(AllocationRepository.java:32)
    at org.quickperf.jvm.allocation.bytewatcher.ByteWatcherRecorder.findRecord(ByteWatcherRecorder.java:45)
    at org.quickperf.jvm.allocation.bytewatcher.ByteWatcherRecorder.findRecord(ByteWatcherRecorder.java:19)
    at org.quickperf.issue.PerfIssuesEvaluator.findPerfRecord(PerfIssuesEvaluator.java:91)
    at org.quickperf.issue.PerfIssuesEvaluator.buildPerfRecordByAnnotation(PerfIssuesEvaluator.java:81)
    at org.quickperf.issue.PerfIssuesEvaluator.evaluatePerfIssuesIfNoJvmIssueWithPotentialUnexpectedException(PerfIssuesEvaluator.java:59)
    at org.quickperf.issue.PerfIssuesEvaluator.evaluatePerfIssuesIfNoJvmIssue(PerfIssuesEvaluator.java:38)
    at org.quickperf.junit5.QuickPerfTestExtension.processJvmOrTestIssue(QuickPerfTestExtension.java:164)
    at org.quickperf.junit5.QuickPerfTestExtension.interceptTestMethod(QuickPerfTestExtension.java:130)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
    at org.junit.jupi

code

package org.acme;

import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;
import org.quickperf.junit5.QuickPerfTest;
import org.quickperf.jvm.allocation.AllocationUnit;
import org.quickperf.jvm.annotations.ExpectMaxHeapAllocation;
import org.quickperf.jvm.annotations.MeasureHeapAllocation;

import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;

@QuickPerfTest
@QuarkusTest
class GreetingResourceTest {

    @MeasureHeapAllocation
    @ExpectMaxHeapAllocation(value = 1, unit = AllocationUnit.GIGA_BYTE)
    @Test
    void testHelloEndpoint() {
        given()
          .when().get("/hello")
          .then()
             .statusCode(200)
             .body(is("Hello s e a"));
    }

}
jeanbisutti commented 4 months ago

The JVM annotations don't work with Quarkus.