чт, 28 нояб. 2024 г. в 13:06, Mark Thomas <ma...@apache.org>:
>
> On 28/11/2024 09:22, Rémy Maucherat wrote:
> > On Thu, Nov 28, 2024 at 10:11 AM <ma...@apache.org> wrote:
> >>
> >> This is an automated email from the ASF dual-hosted git repository.
> >>
> >> markt pushed a commit to branch main
> >> in repository https://gitbox.apache.org/repos/asf/tomcat.git
> >>
> >>
> >> The following commit(s) were added to refs/heads/main by this push:
> >>       new 5970fa4b6c Avoid conflicts over derby.log when tests are run in 
> >> parallel
> >> 5970fa4b6c is described below
> >
> > Thanks for finding the proper way to do it.
>
> I appreciate the thanks but it felt a bit of a hack. I'd rather have set
> the system property just in the tests that used Derby but that would
> have required more invasive changes to expose the temporary directory
> via a static rather than instance method.
>
> Maybe I should do that refactoring. We don't need to worry about
> backwards compatibility for the API for the tests.


> >> @@ -115,6 +115,7 @@ public abstract class LoggingBaseTest {
> >>           tempDir = Files.createTempDirectory(tempBasePath, 
> >> "test").toFile();
> >>
> >>           System.setProperty(Constants.CATALINA_BASE_PROP, 
> >> tempDir.getAbsolutePath());
> >> +        System.setProperty("derby.system.home", 
> >> tempDir.getAbsolutePath());

When tests run in parallel, I wonder whether they run in the same JVM
or in different JVMs. If it is the same JVM then there is a race, as
tempDir will be different for different tests, but both above
properties will be shared.

Regarding refactoring,
as we now have a minimum of Java 8 it might be interesting to update
to JUnit 5 and think of refactoring from there.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to