Mark LoggingHandlerTest with @Isolated to fix flaky build#16338
Merged
Conversation
Motivation: As LoggingHandlerTest depends on static state we should better mark it as `@Isolated` so we not mess up the state sometimes by running test concurrently. Failing to do so can cause issues like: ``` 2026-02-21T04:13:33.0279489Z [ERROR] io.netty.handler.logging.LoggingHandlerTest -- Time elapsed: 0.095 s <<< ERROR! 2026-02-21T04:13:33.0281038Z java.lang.ExceptionInInitializerError 2026-02-21T04:13:33.0282266Z at java.base/java.lang.reflect.Method.invoke(Method.java:566) 2026-02-21T04:13:33.0284143Z at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) 2026-02-21T04:13:33.0285193Z at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) 2026-02-21T04:13:33.0286182Z at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) 2026-02-21T04:13:33.0287200Z at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) 2026-02-21T04:13:33.0288167Z at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) 2026-02-21T04:13:33.0289364Z Suppressed: java.lang.NoClassDefFoundError: Could not initialize class io.netty.handler.logging.LoggingHandlerTest 2026-02-21T04:13:33.0290429Z at java.base/java.lang.reflect.Method.invoke(Method.java:566) 2026-02-21T04:13:33.0291123Z at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) 2026-02-21T04:13:33.0291996Z at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085) 2026-02-21T04:13:33.0292740Z ... 5 more 2026-02-21T04:13:33.0294696Z Caused by: java.lang.ClassCastException: class org.slf4j.helpers.SubstituteLogger cannot be cast to class ch.qos.logback.classic.Logger (org.slf4j.helpers.SubstituteLogger and ch.qos.logback.classic.Logger are in unnamed module of loader 'app') 2026-02-21T04:13:33.0296729Z at io.netty.handler.logging.LoggingHandlerTest.<clinit>(LoggingHandlerTest.java:61) 2026-02-21T04:13:33.0297699Z ... 6 more ``` Modifications: Add `@Isolated` annotation to test class Result: No more test-failures
chrisvest
approved these changes
Feb 23, 2026
netty-project-bot
pushed a commit
that referenced
this pull request
Feb 23, 2026
Motivation: As LoggingHandlerTest depends on static state we should better mark it as `@Isolated` so we not mess up the state sometimes by running test concurrently. Failing to do so can cause issues like: ``` 2026-02-21T04:13:33.0279489Z [ERROR] io.netty.handler.logging.LoggingHandlerTest -- Time elapsed: 0.095 s <<< ERROR! 2026-02-21T04:13:33.0281038Z java.lang.ExceptionInInitializerError 2026-02-21T04:13:33.0282266Z at java.base/java.lang.reflect.Method.invoke(Method.java:566) 2026-02-21T04:13:33.0284143Z at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) 2026-02-21T04:13:33.0285193Z at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) 2026-02-21T04:13:33.0286182Z at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) 2026-02-21T04:13:33.0287200Z at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) 2026-02-21T04:13:33.0288167Z at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) 2026-02-21T04:13:33.0289364Z Suppressed: java.lang.NoClassDefFoundError: Could not initialize class io.netty.handler.logging.LoggingHandlerTest 2026-02-21T04:13:33.0290429Z at java.base/java.lang.reflect.Method.invoke(Method.java:566) 2026-02-21T04:13:33.0291123Z at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) 2026-02-21T04:13:33.0291996Z at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085) 2026-02-21T04:13:33.0292740Z ... 5 more 2026-02-21T04:13:33.0294696Z Caused by: java.lang.ClassCastException: class org.slf4j.helpers.SubstituteLogger cannot be cast to class ch.qos.logback.classic.Logger (org.slf4j.helpers.SubstituteLogger and ch.qos.logback.classic.Logger are in unnamed module of loader 'app') 2026-02-21T04:13:33.0296729Z at io.netty.handler.logging.LoggingHandlerTest.<clinit>(LoggingHandlerTest.java:61) 2026-02-21T04:13:33.0297699Z ... 6 more ``` Modifications: Add `@Isolated` annotation to test class Result: No more test-failures (cherry picked from commit 4e38d60)
Contributor
|
Auto-port PR for 4.1: #16340 |
netty-project-bot
pushed a commit
that referenced
this pull request
Feb 23, 2026
Motivation: As LoggingHandlerTest depends on static state we should better mark it as `@Isolated` so we not mess up the state sometimes by running test concurrently. Failing to do so can cause issues like: ``` 2026-02-21T04:13:33.0279489Z [ERROR] io.netty.handler.logging.LoggingHandlerTest -- Time elapsed: 0.095 s <<< ERROR! 2026-02-21T04:13:33.0281038Z java.lang.ExceptionInInitializerError 2026-02-21T04:13:33.0282266Z at java.base/java.lang.reflect.Method.invoke(Method.java:566) 2026-02-21T04:13:33.0284143Z at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) 2026-02-21T04:13:33.0285193Z at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) 2026-02-21T04:13:33.0286182Z at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) 2026-02-21T04:13:33.0287200Z at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) 2026-02-21T04:13:33.0288167Z at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) 2026-02-21T04:13:33.0289364Z Suppressed: java.lang.NoClassDefFoundError: Could not initialize class io.netty.handler.logging.LoggingHandlerTest 2026-02-21T04:13:33.0290429Z at java.base/java.lang.reflect.Method.invoke(Method.java:566) 2026-02-21T04:13:33.0291123Z at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) 2026-02-21T04:13:33.0291996Z at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085) 2026-02-21T04:13:33.0292740Z ... 5 more 2026-02-21T04:13:33.0294696Z Caused by: java.lang.ClassCastException: class org.slf4j.helpers.SubstituteLogger cannot be cast to class ch.qos.logback.classic.Logger (org.slf4j.helpers.SubstituteLogger and ch.qos.logback.classic.Logger are in unnamed module of loader 'app') 2026-02-21T04:13:33.0296729Z at io.netty.handler.logging.LoggingHandlerTest.<clinit>(LoggingHandlerTest.java:61) 2026-02-21T04:13:33.0297699Z ... 6 more ``` Modifications: Add `@Isolated` annotation to test class Result: No more test-failures (cherry picked from commit 4e38d60)
Contributor
|
Auto-port PR for 5.0: #16341 |
chrisvest
pushed a commit
that referenced
this pull request
Feb 23, 2026
…ild (#16340) Auto-port of #16338 to 4.1 Cherry-picked commit: 4e38d60 --- Motivation: As LoggingHandlerTest depends on static state we should better mark it as `@Isolated` so we not mess up the state sometimes by running test concurrently. Failing to do so can cause issues like: ``` 2026-02-21T04:13:33.0279489Z [ERROR] io.netty.handler.logging.LoggingHandlerTest -- Time elapsed: 0.095 s <<< ERROR! 2026-02-21T04:13:33.0281038Z java.lang.ExceptionInInitializerError 2026-02-21T04:13:33.0282266Z at java.base/java.lang.reflect.Method.invoke(Method.java:566) 2026-02-21T04:13:33.0284143Z at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) 2026-02-21T04:13:33.0285193Z at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) 2026-02-21T04:13:33.0286182Z at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) 2026-02-21T04:13:33.0287200Z at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) 2026-02-21T04:13:33.0288167Z at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) 2026-02-21T04:13:33.0289364Z Suppressed: java.lang.NoClassDefFoundError: Could not initialize class io.netty.handler.logging.LoggingHandlerTest 2026-02-21T04:13:33.0290429Z at java.base/java.lang.reflect.Method.invoke(Method.java:566) 2026-02-21T04:13:33.0291123Z at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) 2026-02-21T04:13:33.0291996Z at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085) 2026-02-21T04:13:33.0292740Z ... 5 more 2026-02-21T04:13:33.0294696Z Caused by: java.lang.ClassCastException: class org.slf4j.helpers.SubstituteLogger cannot be cast to class ch.qos.logback.classic.Logger (org.slf4j.helpers.SubstituteLogger and ch.qos.logback.classic.Logger are in unnamed module of loader 'app') 2026-02-21T04:13:33.0296729Z at io.netty.handler.logging.LoggingHandlerTest.<clinit>(LoggingHandlerTest.java:61) 2026-02-21T04:13:33.0297699Z ... 6 more ``` Modifications: Add `@Isolated` annotation to test class Result: No more test-failures Co-authored-by: Norman Maurer <[email protected]>
normanmaurer
added a commit
that referenced
this pull request
Feb 24, 2026
…ild (#16341) Auto-port of #16338 to 5.0 Cherry-picked commit: 4e38d60 --- Motivation: As LoggingHandlerTest depends on static state we should better mark it as `@Isolated` so we not mess up the state sometimes by running test concurrently. Failing to do so can cause issues like: ``` 2026-02-21T04:13:33.0279489Z [ERROR] io.netty.handler.logging.LoggingHandlerTest -- Time elapsed: 0.095 s <<< ERROR! 2026-02-21T04:13:33.0281038Z java.lang.ExceptionInInitializerError 2026-02-21T04:13:33.0282266Z at java.base/java.lang.reflect.Method.invoke(Method.java:566) 2026-02-21T04:13:33.0284143Z at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) 2026-02-21T04:13:33.0285193Z at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) 2026-02-21T04:13:33.0286182Z at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) 2026-02-21T04:13:33.0287200Z at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) 2026-02-21T04:13:33.0288167Z at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) 2026-02-21T04:13:33.0289364Z Suppressed: java.lang.NoClassDefFoundError: Could not initialize class io.netty.handler.logging.LoggingHandlerTest 2026-02-21T04:13:33.0290429Z at java.base/java.lang.reflect.Method.invoke(Method.java:566) 2026-02-21T04:13:33.0291123Z at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) 2026-02-21T04:13:33.0291996Z at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085) 2026-02-21T04:13:33.0292740Z ... 5 more 2026-02-21T04:13:33.0294696Z Caused by: java.lang.ClassCastException: class org.slf4j.helpers.SubstituteLogger cannot be cast to class ch.qos.logback.classic.Logger (org.slf4j.helpers.SubstituteLogger and ch.qos.logback.classic.Logger are in unnamed module of loader 'app') 2026-02-21T04:13:33.0296729Z at io.netty.handler.logging.LoggingHandlerTest.<clinit>(LoggingHandlerTest.java:61) 2026-02-21T04:13:33.0297699Z ... 6 more ``` Modifications: Add `@Isolated` annotation to test class Result: No more test-failures Co-authored-by: Norman Maurer <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
As LoggingHandlerTest depends on static state we should better mark it as
@Isolatedso we not mess up the state sometimes by running test concurrently. Failing to do so can cause issues like:Modifications:
Add
@Isolatedannotation to test classResult:
No more test-failures