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

Tests were failing on 5.1.7-arch1-1-ARCH #1

Merged
merged 1 commit into from Jun 15, 2019

Conversation

@ablanchard
Copy link
Contributor

@ablanchard ablanchard commented Jun 15, 2019

Bug

Tests were failing with the following stack

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.quickperf.junit4.QuickPerfJUnitRunnerTest

Unable to run test in a new JMV: Exception in thread "main" java.lang.IllegalStateException: java.io.FileNotFoundException: /tmpQuickPerf-1470442387/junitFailures.ser (Aucun fichier ou dossier de ce type)
	at org.quickperf.repository.ObjectOutputStreamBuilder.buildFileOutputStream(ObjectOutputStreamBuilder.java:51)
	at org.quickperf.repository.ObjectOutputStreamBuilder.build(ObjectOutputStreamBuilder.java:33)
	at org.quickperf.repository.ObjectFileRepository.save(ObjectFileRepository.java:40)
	at org.quickperf.junit4.JUnit4FailuresRepository.save(JUnit4FailuresRepository.java:37)
	at org.quickperf.junit4.QuickPerfJunit4Core.main(QuickPerfJunit4Core.java:37)
Caused by: java.io.FileNotFoundException: /tmpQuickPerf-1470442387/junitFailures.ser (Aucun fichier ou dossier de ce type)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:187)
	at org.quickperf.repository.ObjectOutputStreamBuilder.buildFileOutputStream(ObjectOutputStreamBuilder.java:49)
	... 4 more

Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.181 s <<< FAILURE! - in org.quickperf.junit4.QuickPerfJUnitRunnerTest
a_test_with_failing_business_code_and_a_performance_issue_in_a_specific_jvm(org.quickperf.junit4.QuickPerfJUnitRunnerTest)  Time elapsed: 1.181 s  <<< FAILURE!
org.assertj.core.api.SoftAssertionError: 

The following assertion failed:
1) 
Expecting:
 <"
Time: 1,146
There was 1 failure:
1) failing_test(org.quickperf.junit4.ClassWithFuntionalIssueInNewJvmAndPerfIssue)
java.lang.IllegalStateException: java.io.FileNotFoundException: /tmpQuickPerf-1470442387/allocation.ser (Aucun fichier ou dossier de ce type)
	at org.quickperf.repository.ObjectInputStreamBuilder.buildFileInputStream(ObjectInputStreamBuilder.java:48)
	at org.quickperf.repository.ObjectInputStreamBuilder.buildObjectInputStream(ObjectInputStreamBuilder.java:30)
	at org.quickperf.repository.LongFileRepository.retrieveLongValueFromFile(LongFileRepository.java:58)
	at org.quickperf.repository.LongFileRepository.find(LongFileRepository.java:49)
	at org.quickperf.jvm.allocation.AllocationRepository.findAllocation(AllocationRepository.java:34)
	at org.quickperf.jvm.allocation.bytewatcher.ByteWatcherRecorder.findRecord(ByteWatcherRecorder.java:64)
	at org.quickperf.jvm.allocation.bytewatcher.ByteWatcherRecorder.findRecord(ByteWatcherRecorder.java:21)
	at org.quickperf.junit4.MainJvmAfterJUnitStatement.findPerfRecord(MainJvmAfterJUnitStatement.java:210)
	at org.quickperf.junit4.MainJvmAfterJUnitStatement.buildPerfRecordByAnnotation(MainJvmAfterJUnitStatement.java:200)
	at org.quickperf.junit4.MainJvmAfterJUnitStatement.evaluate(MainJvmAfterJUnitStatement.java:84)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.junit.experimental.results.PrintableResult.testResult(PrintableResult.java:36)
	at org.junit.experimental.results.PrintableResult.testResult(PrintableResult.java:29)
	at org.quickperf.junit4.QuickPerfJUnitRunnerTest.a_test_with_failing_business_code_and_a_performance_issue_in_a_specific_jvm(QuickPerfJUnitRunnerTest.java:50)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:410)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.FileNotFoundException: /tmpQuickPerf-1470442387/allocation.ser (Aucun fichier ou dossier de ce type)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.quickperf.repository.ObjectInputStreamBuilder.buildFileInputStream(ObjectInputStreamBuilder.java:46)
	... 41 more

FAILURES!!!
Tests run: 1,  Failures: 1

">
to contain:
 <"Performance and functional properties not respected"> 

	at org.quickperf.junit4.QuickPerfJUnitRunnerTest.a_test_with_failing_business_code_and_a_performance_issue_in_a_specific_jvm(QuickPerfJUnitRunnerTest.java:57)


Results:

Failures: 
  QuickPerfJUnitRunnerTest.a_test_with_failing_business_code_and_a_performance_issue_in_a_specific_jvm:57 
The following assertion failed:
1) 
Expecting:
 <"
Time: 1,146
There was 1 failure:
1) failing_test(org.quickperf.junit4.ClassWithFuntionalIssueInNewJvmAndPerfIssue)
java.lang.IllegalStateException: java.io.FileNotFoundException: /tmpQuickPerf-1470442387/allocation.ser (Aucun fichier ou dossier de ce type)
	at org.quickperf.repository.ObjectInputStreamBuilder.buildFileInputStream(ObjectInputStreamBuilder.java:48)
	at org.quickperf.repository.ObjectInputStreamBuilder.buildObjectInputStream(ObjectInputStreamBuilder.java:30)
	at org.quickperf.repository.LongFileRepository.retrieveLongValueFromFile(LongFileRepository.java:58)
	at org.quickperf.repository.LongFileRepository.find(LongFileRepository.java:49)
	at org.quickperf.jvm.allocation.AllocationRepository.findAllocation(AllocationRepository.java:34)
	at org.quickperf.jvm.allocation.bytewatcher.ByteWatcherRecorder.findRecord(ByteWatcherRecorder.java:64)
	at org.quickperf.jvm.allocation.bytewatcher.ByteWatcherRecorder.findRecord(ByteWatcherRecorder.java:21)
	at org.quickperf.junit4.MainJvmAfterJUnitStatement.findPerfRecord(MainJvmAfterJUnitStatement.java:210)
	at org.quickperf.junit4.MainJvmAfterJUnitStatement.buildPerfRecordByAnnotation(MainJvmAfterJUnitStatement.java:200)
	at org.quickperf.junit4.MainJvmAfterJUnitStatement.evaluate(MainJvmAfterJUnitStatement.java:84)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.junit.experimental.results.PrintableResult.testResult(PrintableResult.java:36)
	at org.junit.experimental.results.PrintableResult.testResult(PrintableResult.java:29)
	at org.quickperf.junit4.QuickPerfJUnitRunnerTest.a_test_with_failing_business_code_and_a_performance_issue_in_a_specific_jvm(QuickPerfJUnitRunnerTest.java:50)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:410)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.FileNotFoundException: /tmpQuickPerf-1470442387/allocation.ser (Aucun fichier ou dossier de ce type)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.quickperf.repository.ObjectInputStreamBuilder.buildFileInputStream(ObjectInputStreamBuilder.java:46)
	... 41 more

FAILURES!!!
Tests run: 1,  Failures: 1

">
to contain:
 <"Performance and functional properties not respected"> 


Tests run: 2, Failures: 1, Errors: 0, Skipped: 0

Fix

Use java nio temp directory creation

@jeanbisutti jeanbisutti merged commit 3ff20c3 into quick-perf:master Jun 15, 2019
jeanbisutti added a commit that referenced this issue May 29, 2020
* Initial Commit. Reformat, Rearrange, CheckStyle and Tests required.

* Added AllocationRate test classes

* Pretty formatting of Jvm Profiling output.

* Fix failing tests

* Minor test improvements

* Add licence headers

* Minor improvements

* Fix build issue and simplify exception management

* Simplify exception management

* Time stamp should have no reason to be negative

* Fix typo

* Fix compilation warning

* Separation of concerns and code simplification

* Extract methods

* Allocation duration has no reason to be negative

* Remove local variable

* Should return an empty string if allocation duration is zero

* Simplify code by removing not possible test cases

* Remove compilation warning

* Item collection has no reason to be null

* Thre is no reason to don't have JFR events

* With this removal, a blank string is always return when no allocation events

* Invert code lines

* Remove local variables

* Improve separation of concerns

Co-authored-by: Edward Rose <exr194@cs.bham.ac.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants