[9] RFR(S): 8066433: Copy Whitebox testlibrary to top level repository

Stefan Särne stefan.sarne at oracle.com
Mon Dec 8 10:19:26 UTC 2014

I think this is a good path forward.

The WhiteBox api is just the next example of test library code which we 
want to use both from the hotspot and the jdk repo. There are other 
classes which exists in both repos, which currently are copies. And just 
as expected with copies - time is spent to keep them in sync and yet 
they are not. Copy vs. share is a trade off but in this case I lean 
towards share, since this has been brought up as an issue at multiple 
times. Other examples are ProcessTools, OutputAnalyzer and friends.

If we treat the WhiteBox API as a pilot, we should create an RFE that 
follows up for the other utilities.
This would also be a good place to discuss the structure of the test 

I don't see a shared test library replacing the local ones - it would 
just a be a complement when the library code is shared.

If we do setup a shared place for this, we also should have a good way 
to handle changes to it.
It would be easy to start here - on jdk9-dev, but if it turns out to be 
needed, we could setup a separate list.

Based on the discussion around microbenchmarks, it may make sense to 
break out the test folder to a separate repo if it starts growing.
But again, perhaps this is something we can wait for and handle in the 
RFE. The test folder already exists in the top repo.


Tobias Hartmann skrev 2014-12-08 10:06:
> CC'ing to jdk9-dev for wider audience.
> Summary:
> The tests for the 'Segmented Code Cache' JEP [1] and other JDK tests [2] need
> access to the Whitebox API testlibrary that is part of the hotspot repository.
> We therefore propose to move the Whitebox API from the hotspot repository to the
> top level repository (test/testlibrary/) in the following steps:
> 1) Copy testlibrary to top level repository
> 2) Adapt existing hotspot tests (> 200 tests)
> 3) Remove testlibrary from hotspot repository
> First step: http://cr.openjdk.java.net/~thartmann/8066433/webrev.01/
> Thanks,
> Tobias
> [1] https://bugs.openjdk.java.net/browse/JDK-8066625
> [2] https://bugs.openjdk.java.net/browse/JDK-8064875
> On 08.12.2014 08:37, Staffan Larsen wrote:
>> I am for this change in principle, but before we go ahead I think this warrants a larger discussion on build-dev at ojn or jdk9-dev at ojn. We need to propose and get acceptance for this from the larger group.
>> (I was also surprised to see a Makefile here - who calls that?)
>> /Staffan
>>> On 8 dec 2014, at 08:24, Tobias Hartmann <Tobias.Hartmann at oracle.com> wrote:
>>> Hi,
>>> As we discussed off-thread I copied the Whitebox API to the top level repository
>>> (test/testlibrary). We will then file a RFE to adopt the hotspot tests and
>>> eventually remove the testlibrary from the hotspot repo.
>>> New webrev: http://cr.openjdk.java.net/~thartmann/8066433/webrev.01/
>>> Can I get reviews for this?
>>> Thanks,
>>> Tobias
>>> On 04.12.2014 11:29, Staffan Larsen wrote:
>>>> I don’t know which tests you are planning to write that require this feature, but can the tests be put into the hotspot repo instead of the jdk repo so that we avoid the duplication? It seems like the decision for JDK-8057707 was to not duplicate the code.
>>>> /Staffan
>>>>> On 4 dec 2014, at 08:32, Tobias Hartmann <Tobias.Hartmann at oracle.com> wrote:
>>>>> Mikael, Staffan, it looks like as if we don't have a nice solution for sharing
>>>>> the library at the moment. What do you think about having the duplication as an
>>>>> intermediate solution until we get the necessary support from jtreg / jprt to
>>>>> share the library?
>>>>> There are also other JDK tests that would benefit from having the Whitebox API
>>>>> available. For example, JDK-8057707 [1].
>>>>> Thanks,
>>>>> Tobias
>>>>> [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-September/028532.html
>>>>> On 02.12.2014 20:54, Tobias Hartmann wrote:
>>>>>> Hi Staffan,
>>>>>> thanks for the feedback.
>>>>>> On 02.12.2014 20:45, Staffan Larsen wrote:
>>>>>>>> On 2 dec 2014, at 20:25, Staffan Larsen <staffan.larsen at oracle.com> wrote:
>>>>>>>>> On 2 dec 2014, at 18:37, Tobias Hartmann <Tobias.Hartmann at oracle.com> wrote:
>>>>>>>>> Hi Mikael,
>>>>>>>>> On 02.12.2014 18:22, Mikael Vidstedt wrote:
>>>>>>>>>> Tobias,
>>>>>>>>>> Have you looked at what it would take to move the testlibrary somewhere where it
>>>>>>>>>> can actually be shared instead? I think it would be extremely unfortunate to
>>>>>>>>>> copy the code. I can't stress that enough.
>>>>>>>>> I agree that having the testlibrary in a shared location is definitely the best
>>>>>>>>> solution. Unfortunately, I don't know how to do that since we have to access the
>>>>>>>>> library from different repositories and I don't think we want to have path
>>>>>>>>> dependencies between the repositories.
>>>>>>>>> Any suggestions?
>>>>>>>> jtreg currently requires the testlibrary to be located in or under the directory with the TEST.ROOT file. To move it somewhere else we need to change jtreg first - and I think we should.
>>>>>>> I’ve been told that it is actually possible to do this with the current jtreg by using an ugly path such as:
>>>>>>>   @library /../../test/testlibrary
>>>>>>> I don’t think that is what we want to do…
>>>>>> Yes, that's what I meant with "path dependencies between repositories". I don't
>>>>>> think this is a very robust solution.
>>>>>> Best,
>>>>>> Tobias
>>>>>>> /Staffan
>>>>>>>> /Staffan
>>>>>>>>> Thanks,
>>>>>>>>> Tobias
>>>>>>>>>> Cheers,
>>>>>>>>>> Mikael
>>>>>>>>>> On 2014-12-02 06:40, Tobias Hartmann wrote:
>>>>>>>>>>> Hi,
>>>>>>>>>>> please review the following patch that copies the Whitebox testlibrary to
>>>>>>>>>>> /jdk/test. This is needed to enhance and fix jdk tests (for example, see [1]).
>>>>>>>>>>> The change leads to code duplication but in my opinion we should favour stable
>>>>>>>>>>> tests over code duplication here. Hopefully, there is a solution to share the
>>>>>>>>>>> library in the future.
>>>>>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8066433
>>>>>>>>>>> Webrev: http://cr.openjdk.java.net/~thartmann/8066433/webrev.00/
>>>>>>>>>>> Thanks,
>>>>>>>>>>> Tobias

More information about the hotspot-dev mailing list