-
Notifications
You must be signed in to change notification settings - Fork 79
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
7903519 : jtreg/jtharness is missing features for basic crash testing #235
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back andrlos! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
A test status listener (in the sense of JUnit's TestWatcher) would be okay-ish, but a general test status transforming SPI is too intrusive and intransparent ... and also exposing an internal field of In the light of the above, I tend to close this PR. What would an implementation handling "crashtesting" look like? Do you have a draft for it? |
@sormuras feast your eyes on the code below :D
this is an approach that we use for crashtesting with debug jdk builds to separate crashes from regular failures |
Hello @andrlos, looking at that code you pasted: if(originalStatus.getType() == Status.FAILED && ! this.didCrash(td)){
newStatus = new Status(Status.PASSED, "Just a regular failure.");
} It looks odd to be marking a failed test as successful. Furthermore, doesn't a crashed JVM result in test status to be |
And sometimes tests do produce Where (console log, web-view, ...) do you check for such crashes? Manually or with tool/script support? Isn't it possible to implement/apply an after-the-fact filter that doesn't rewrite actual run results? |
@sormuras it proved to be much harder to filter them after, as the hs_err_pid log is not being copied, plus we have many tests that run via a shell script, so a generic jvm watcher is not an option as would be the option with jvm agent that we use for junit testing.. we need to cover cases, where jvm crashes even tho it has been run via a shell script (or multiple levels of scripts) and watching for hs_err_pid.log proved to be the most reliable and universal approach. |
@jaikiran |
@sormuras @jaikiran I would like to also point out, since Junit has been already mentioned here, that JUnit since JUnit4 provides a feature called TestRule where you can implement a custom testRule, that allows the user to modify behavior of any test.. It can be used in a similar scenario, by implementing a TestRule that ignores any regular exceptions, thus only reporting JVM crashes as failures. https://github.com/junit-team/junit4/blob/HEAD/doc/ReleaseNotes4.9.md |
provides SPI for enabling external status transformations of failed tests
this is a continuation of efforts after openjdk/jtharness#59
Requires newest jtharness build (not even tagged yet) that includes above mentioned change to be compiled succesfully
The main idea is to provide a unified StatusTransformer interface, that can be externally implemented by users and added to a classpath in a separate jar to allow modifications of test execution status based on some elementary analysis. This can be easily used for crashtesting (filtering out only tests with jvm crashes).
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jtreg.git pull/235/head:pull/235
$ git checkout pull/235
Update a local copy of the PR:
$ git checkout pull/235
$ git pull https://git.openjdk.org/jtreg.git pull/235/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 235
View PR using the GUI difftool:
$ git pr show -t 235
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jtreg/pull/235.diff
Using Webrev
Link to Webrev Comment