Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with hierarchy of unit-tests classes #191

Open
blacelle opened this issue Nov 16, 2022 · 0 comments
Open

Issue with hierarchy of unit-tests classes #191

blacelle opened this issue Nov 16, 2022 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@blacelle
Copy link

Describe the bug
I consider some tests based on an abstract method:

@RunWith(QuickPerfJUnitRunner.class)
public abstract class ATest {

	protected abstract void benchMe();

	@MeasureHeapAllocation
	@Test
	public void testHeapAllocation() {
		benchMe();
	}
}

and the implementation in a sub-class:

@RunWith(QuickPerfJUnitRunner.class)
public class Test extends ATest {

	@Override
	protected void benchMe() {
		// empty
	}
}

Expected behavior
Run smoothly

Actual behavior

It fails with:

	at org.quickperf.issue.PerfIssuesEvaluator.evaluatePerfIssuesIfNoJvmIssue(PerfIssuesEvaluator.java:45)
	at org.quickperf.junit4.MainJvmAfterJUnitStatement.evaluate(MainJvmAfterJUnitStatement.java:62)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.lang.IllegalStateException: java.io.FileNotFoundException: /var/folders/8b/p64c8tfs4d7gf3v8tcmwbz580000gn/T/QuickPerf-521872497461803058/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)
	... 19 more
	Suppressed: java.lang.InstantiationException
Caused by: java.io.FileNotFoundException: /var/folders/8b/p64c8tfs4d7gf3v8tcmwbz580000gn/T/QuickPerf-521872497461803058/allocation.ser (No such file or directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.quickperf.repository.ObjectInputStreamBuilder.buildFileInputStream(ObjectInputStreamBuilder.java:44)
	... 29 more

To Reproduce
(Please provide a link to a live example or steps to reproduce this behavior.)

Versions

  • QuickPerf: 1.1.0
  • JDK: 17
@blacelle blacelle added the 🐛 bug Something isn't working label Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant