RFR: 8321192 : j.a.PrintJob/ImageTest/ImageTest.java: Fail or skip the test if there's no printer

Alexey Ivanov aivanov at openjdk.org
Mon Feb 12 19:34:06 UTC 2024


On Sun, 11 Feb 2024 19:38:28 GMT, Phil Race <prr at openjdk.org> wrote:

>> Hi Reviewers,
>> I have updated the test with 'PassFailJFrame' with programmatically generating image and print , please review and let me know your suggestions.
>
> I had a slack chat with Jon Gibbons (maintainer of jtreg) and he thinks FAIL would be better here.
> I think we should be consistent and now that all tests that need a printer specify @key printer - 
> should FAIL if there's no printer. Not saying we have to rush off and change them all immediately,
> but if we are updating it anyway for some reason then do it.

@prrace You're right. I was under impression that `jtreg.SkippedException` gives the test a distinct status from either *Pass* or *Fail*. Eventually, it's not the case.

In verbose mode, I can see the exception:


runner starting test: java/awt/PrintJob/test/FailedTest.java
runner finished test: java/awt/PrintJob/test/FailedTest.java
Failed. Execution failed: `main' threw exception: java.lang.Error: Fail the test
runner starting test: java/awt/PrintJob/test/PassedTest.java
runner finished test: java/awt/PrintJob/test/PassedTest.java
Passed. Execution successful
runner starting test: java/awt/PrintJob/test/SkippedTest.java
runner finished test: java/awt/PrintJob/test/SkippedTest.java
Passed. Skipped: jtreg.SkippedException: Skip the test
Test results: passed: 2; failed: 1

This is why I thought it was recorded as a different status.

At the same time, the report looks like this:

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR   
>> jtreg:open/test/jdk/java/awt/PrintJob/test            3     2     1     0 <<
==============================
TEST FAILURE


If `jtreg.SkippedException` resulted in a status distinct from *Pass* or *Fail*, it would be more useful.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17790#issuecomment-1939412090


More information about the client-libs-dev mailing list