On Thu, 11 Jan 2024 14:17:39 GMT, Erik Joelsson <er...@openjdk.org> wrote:

>> In principle, I think tests should be executed from their corresponding 
>> test-support directory. (I think there is some JBS issue for this that's 
>> been around for some while.) The rationale is that this is a good directory 
>> for any arbitrary output generated from the test, for files that are just 
>> dumped in the current directory. (This happens from time to time with tests.)
>> 
>> But if executing from the test image improves the code quality of the tests, 
>> I am not going to argue heavily against it.
>
>> In principle, I think tests should be executed from their corresponding 
>> test-support directory. (I think there is some JBS issue for this that's 
>> been around for some while.) The rationale is that this is a good directory 
>> for any arbitrary output generated from the test, for files that are just 
>> dumped in the current directory. (This happens from time to time with tests.)
> 
> Magnus does bring up a good point. The root of the test image is a very bad 
> place to accidentally drop arbitrary files when run in our distributed test 
> system, but we don't really run the micros there, at least not like this, do 
> we?

If the test image dir could be relative to the test-support directory (via a 
symlink, or knowing that `../test/` always points to the test image) then 
running from out of there could work. As @erikj79 has figured out then the root 
issue for me here is that it's not feasible to pass the test image directory as 
a parameter (since the `@Fork` annotation needs compile-time constants), so if 
it's possible to configure test-support directories to be in arbitrary places 
then that would become very fragile.

None of our JMH tests pollutes the current directory as far as I'm aware, 
though. And if they did the current situation where the micros are run out of 
the make directory might arguably be worse.

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

PR Comment: https://git.openjdk.org/jdk/pull/17349#issuecomment-1887373227

Reply via email to