You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2022/07/17 04:14:34 UTC

[logging-log4j2] branch master updated: Add exclusive lock to SimpleLoggerTest

This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/master by this push:
     new a7c2beb1c5 Add exclusive lock to SimpleLoggerTest
a7c2beb1c5 is described below

commit a7c2beb1c5cfebe615d4a76cbba1f8d5bfbe702b
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Sun Jul 17 06:14:24 2022 +0200

    Add exclusive lock to SimpleLoggerTest
    
    The test modifies the `LoggerContextFactory`, so it either needs to run
    separately from all other tests or we can mark all other tests that use
    a `LoggerContextFactory`.
---
 .../test/java/org/apache/logging/log4j/simple/SimpleLoggerTest.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/log4j-api-test/src/test/java/org/apache/logging/log4j/simple/SimpleLoggerTest.java b/log4j-api-test/src/test/java/org/apache/logging/log4j/simple/SimpleLoggerTest.java
index 8f44d839ab..d56c1aedf9 100644
--- a/log4j-api-test/src/test/java/org/apache/logging/log4j/simple/SimpleLoggerTest.java
+++ b/log4j-api-test/src/test/java/org/apache/logging/log4j/simple/SimpleLoggerTest.java
@@ -22,8 +22,12 @@ import org.apache.logging.log4j.test.junit.LoggerContextFactoryExtension;
 import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.parallel.ResourceLock;
+import org.junit.jupiter.api.parallel.Resources;
 
 @Tag("smoke")
+// TODO: use a 'LoggerContextFactory` lock
+@ResourceLock(value = Resources.GLOBAL)
 public class SimpleLoggerTest {
 
     @RegisterExtension