RFR: (small): JDK-8190307: SA: Sanity tests for the clhsdb commands: universe, intconstant, type
David Holmes
david.holmes at oracle.com
Mon Oct 30 05:05:37 UTC 2017
Hi Jini,
OutputAnalyzer has a bunch of methods that deal with checking return
values and output contents, and throwing exceptions (not assertion
failures!) so that you don't need to manually do all that. It also
prints diagnostics to aid with debugging when things do not contain what
is expected.
Looking at the individual tests:
TestIntConstant.java
92
Asserts.assertTrue(output.contains("CollectedHeap::G1CollectedHeap 2"));
93 Asserts.assertTrue(output.contains("RUNNABLE 2"));
94 Asserts.assertTrue(output.contains("_thread_uninitialized
0"));
95 Asserts.assertTrue(output.contains("intConstant
_temp_constant 45"));
Apart from the last line this expected output looks very strange. If
this indeed what we expect from issuing those commands we should
document/comment what corresponds to what.
Plus this assumes G1 is being used but Lingered App is started using the
test run vmOptions AFAICS so it would use whatever GC were passed
through, wouldn't it?
---
TestType.java
The expected output is not quite so strange, but still could do with
some commentary.
90 Asserts.assertTrue(output.contains("type G1CollectedHeap
CollectedHeap"));
Same comment about assuming G1.
Thanks,
David
------
On 30/10/2017 1:44 PM, Jini George wrote:
> Hello,
>
> We have been working on writing sanity tests for the various jhsdb
> clhsdb commands of the SA to improve the robustness of the SA. As a part
> of this, here is a webrev for sanity tests for 3 of the clhsdb commands:
>
> Bug ID: https://bugs.openjdk.java.net/browse/JDK-8190307
> webrev: http://cr.openjdk.java.net/~jgeorge/8190307/webrev.00/
>
> I would like to request for reviews for this simple addition.
>
> Thank you,
> Jini.
More information about the serviceability-dev
mailing list