You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Volkan Yazıcı <vo...@gmail.com> on 2020/11/10 15:51:31 UTC
org.apache.logging.log4j.LoggerTest.mdc failure
log4j-1.2-api/src/test/java/org/apache/log4j/LoggerTest.java:556 on master
fails on OSX with the following error:
Test Year is null ==> expected: not <null>
I am suspecting parallel execution for this. That is, context map getting
mutated concurrently. Otherwise I have no idea why would this fail:
ThreadContext.put("TestYear", Integer.valueOf(2010).toString());
logger.debug("Debug message");
String testYear = ThreadContext.get("TestYear");
assertNotNull(testYear, "Test Year is null");
Any ideas?
Re: org.apache.logging.log4j.LoggerTest.mdc failure
Posted by Matt Sicker <bo...@gmail.com>.
That module isn't set up for parallel execution yet, and I don't think
I've even updated any tests there yet, either. If it's in log4j-api,
then yes, that could be from concurrency issues which might be due to
a missing annotation for indicating thread context dependence
(@UsingAnyThreadContext or something like that; I forget the actual
name at the moment).
On Tue, 10 Nov 2020 at 09:53, Volkan Yazıcı <vo...@gmail.com> wrote:
>
> log4j-1.2-api/src/test/java/org/apache/log4j/LoggerTest.java:556 on master
> fails on OSX with the following error:
>
> Test Year is null ==> expected: not <null>
>
> I am suspecting parallel execution for this. That is, context map getting
> mutated concurrently. Otherwise I have no idea why would this fail:
>
> ThreadContext.put("TestYear", Integer.valueOf(2010).toString());
> logger.debug("Debug message");
> String testYear = ThreadContext.get("TestYear");
> assertNotNull(testYear, "Test Year is null");
>
> Any ideas?