You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2026/07/27 13:12:49 UTC

(sling-whiteboard) branch issue/fix-build created (now b8e32225)

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

rombert pushed a change to branch issue/fix-build
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


      at b8e32225 SLING-13270 : fix LoggerPrinterTest flakiness on windows by using platform line separator

This branch includes the following new commits:

     new c6f229e8 SLING-13270 : fix flaky OsgiConfiguratorTest by reloading logback.xml explicitly
     new b8e32225 SLING-13270 : fix LoggerPrinterTest flakiness on windows by using platform line separator

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(sling-whiteboard) 01/02: SLING-13270 : fix flaky OsgiConfiguratorTest by reloading logback.xml explicitly

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch issue/fix-build
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit c6f229e8140f23c32c7b5f88a754e344e02fbf37
Author: Rishabh Kumar <di...@adobe.com>
AuthorDate: Thu Jul 23 22:59:30 2026 +0530

    SLING-13270 : fix flaky OsgiConfiguratorTest by reloading logback.xml explicitly
---
 .../sling/commons/log/json/impl/OsgiConfiguratorTest.java      | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/json-logs/org.apache.sling.commons.log.json/src/test/java/org/apache/sling/commons/log/json/impl/OsgiConfiguratorTest.java b/json-logs/org.apache.sling.commons.log.json/src/test/java/org/apache/sling/commons/log/json/impl/OsgiConfiguratorTest.java
index 4ca0c136..e4d0bcbd 100644
--- a/json-logs/org.apache.sling.commons.log.json/src/test/java/org/apache/sling/commons/log/json/impl/OsgiConfiguratorTest.java
+++ b/json-logs/org.apache.sling.commons.log.json/src/test/java/org/apache/sling/commons/log/json/impl/OsgiConfiguratorTest.java
@@ -36,6 +36,7 @@ import org.slf4j.LoggerFactory;
 import ch.qos.logback.classic.Level;
 import ch.qos.logback.classic.Logger;
 import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.joran.JoranConfigurator;
 
 public class OsgiConfiguratorTest {
 
@@ -43,8 +44,15 @@ public class OsgiConfiguratorTest {
     public final OsgiContext context = new OsgiContext();
 
     @Before
-    public void init() {
+    public void init() throws Exception {
+        // reset and reload the logback.xml test config explicitly: another test class
+        // may have already reset the LoggerContext, wiping out the "console" appender
+        // that this test's rootLogger.getAppender(...) lookup depends on
         LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
+        loggerContext.reset();
+        JoranConfigurator configurator = new JoranConfigurator();
+        configurator.setContext(loggerContext);
+        configurator.doConfigure(getClass().getResource("/logback.xml"));
         loggerContext.start();
     }
 


(sling-whiteboard) 02/02: SLING-13270 : fix LoggerPrinterTest flakiness on windows by using platform line separator

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch issue/fix-build
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit b8e32225db3fa35460d9bf047d3f8ee34a69b5c6
Author: Rishabh Kumar <di...@adobe.com>
AuthorDate: Fri Jul 24 00:27:16 2026 +0530

    SLING-13270 : fix LoggerPrinterTest flakiness on windows by using platform line separator
    
    Co-Authored-By: Claude Sonnet 5 <no...@anthropic.com>
---
 .../java/org/apache/sling/commons/log/json/impl/LoggerPrinter.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/json-logs/org.apache.sling.commons.log.json/src/main/java/org/apache/sling/commons/log/json/impl/LoggerPrinter.java b/json-logs/org.apache.sling.commons.log.json/src/main/java/org/apache/sling/commons/log/json/impl/LoggerPrinter.java
index eb71851d..18023245 100644
--- a/json-logs/org.apache.sling.commons.log.json/src/main/java/org/apache/sling/commons/log/json/impl/LoggerPrinter.java
+++ b/json-logs/org.apache.sling.commons.log.json/src/main/java/org/apache/sling/commons/log/json/impl/LoggerPrinter.java
@@ -58,7 +58,8 @@ public class LoggerPrinter extends BasicStatusManager {
     }
 
     private void renderHeader(PrintWriter pw, String header) {
-        pw.println("\n\n" + header + "\n-------------------\n");
+        String nl = System.lineSeparator();
+        pw.println(nl + nl + header + nl + "-------------------" + nl);
     }
 
     private String statusToString(Status status) {
@@ -74,7 +75,7 @@ public class LoggerPrinter extends BasicStatusManager {
      */
     public void printConfiguration(PrintWriter pw) {
 
-        pw.println(HEADLINE + "\n===========================");
+        pw.println(HEADLINE + System.lineSeparator() + "===========================");
 
         renderHeader(pw, "Status");
         this.getCopyOfStatusList().stream().map(this::statusToString).forEach(pw::println);