Can't build log4j main branch

2024-09-11 Thread Gary D. Gregory
Hi All,

Running 'mvn clean install' on git main [1] gives me:

[ERROR] Failures:
[ERROR]   AsyncLoggerConfigTest.testSingleFilterInvocation:114
Wanted but not invoked:
appender.append();
-> at 
org.apache.logging.log4j.async.logger.AsyncLoggerConfigTest.testSingleFilterInvocation(AsyncLoggerConfigTest.java:114)

However, there was exactly 1 interaction with this mock:
appender.getName();
-> at 
org.apache.logging.log4j.core.config.AppenderControl.(AppenderControl.java:50)

I am using:

Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: C:\java\apache-maven-3.9.9
Java version: 17.0.12, vendor: Eclipse Adoptium, runtime: C:\Program 
Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Is it just me?

Gary
[1] commit 8be94bcec2cdb04c6aa28abe17c4e2d16f30 (HEAD -> main, origin/main)


Re: Can't build log4j main branch

2024-09-11 Thread Piotr P. Karwasz
Hi Gary,

On Wed, 11 Sept 2024 at 22:13, Gary D. Gregory  wrote:
> Running 'mvn clean install' on git main [1] gives me:
>
> [ERROR] Failures:
> [ERROR]   AsyncLoggerConfigTest.testSingleFilterInvocation:114
> Wanted but not invoked:
> appender.append();
> -> at 
> org.apache.logging.log4j.async.logger.AsyncLoggerConfigTest.testSingleFilterInvocation(AsyncLoggerConfigTest.java:114)
>
> However, there was exactly 1 interaction with this mock:
> appender.getName();
> -> at 
> org.apache.logging.log4j.core.config.AppenderControl.(AppenderControl.java:50)

In this test a message is sent through `AsyncLoggerConfig` and we wait
up to 100 ms until `Appender.append()` is called on the asynchronous
thread.
I guess this _might_ fail on an extremely busy host. If your host was
not so busy, we might have a performance problem with LMAX Disruptor.

I bumped the maximum delay to up to 1 s, hope it helps.

Piotr

PS: On a side note: `log4j-mongodb` might fail on some hosts (e.g. my
Debian 12), since it requires some specific versions of OpenSSL and
other libraries.
That is why I proposed to start the Mongo server from Docker in [1].

[1] https://github.com/apache/logging-log4j2/pull/2922