-
Notifications
You must be signed in to change notification settings - Fork 68
Provides RSS annotations #39
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
Conversation
20e4ea1
to
0563bd3
Compare
Thanks for your work @loicmathieu! I created a PR containing small minor improvements and the RSS tests ignored for Mac OS. Feedbacks for improvement:
RSS annotations are very promising! Thanks! |
@jeanbisutti I merged your PR thanks.
MacOS is a POSIX system so it should works. We can merged as is and open an issue for it if I didn't find why it didn't works. Do you have a Mac? If so you can have a look maybe the directory for the PID file is not the same on MacOS and Linux ...
Done
I'm not happy with the fork/nofork dance and I need to check some usecases before deciding what to do with it. Maybe what we need is a way to define from wich PID we gather the statistics (default to the current one) as some framework could decide to start the process before (like Quarkus did for native tests). That's why it's still a draft PR :). I will take your feedback into account and analyse some usecase before going back with a better implementation.
Yes, and I also need to make the documentation for the JUnit5 support :) |
I don't have a Mac... We could open an issue for this. It seems a good idea to explore several use cases before choosing the final implementation. |
I think the correct implementation for gathering the PID is default to the current one or the forked one in case of JVM forks. The RSS annotation should not mandate a fork by itself. Or should it ? |
JVM annotation is launched in a specific JVM with the help of a ProcessBuilder (see NewJvmTestLauncher class). So the OS should create a specific process to run this test. Therefore, I see several advantages of forking the JVM with the RSS annotations:
|
Wether or not they measure RSS, several test executing concurrently or the one after the other could impact RSS significantly so yes, forking is needed ... Anyway I want to test this with SringBoot/Micronaut/Quarkus integration tests as this annotation will make sense to measure RSS of an integration test not much of a simple unit test |
4864077
to
03ef8da
Compare
Thanks for your work @loicmathieu! It's great! |
@jeanbisutti I remove the ability to avoid forking the VM as discussed. |
Ah, just saw that it's already merged ;) |
Fixes #21
This PR adds RSS annotations to measure the Resident Set Size of the process of the test methods.
This only works for Linux.
It adds the capability to gather process statistics so other annotations can take advantage of it.
It adds the capability from an anotation to skip the fork if needed.