For me the test runs fine with both Java 7 and Java 8. But according to your stack traces it seems that the table array within ThreadLocalMap contains some null entries (compare with https://doanduyhai.wordpress.com/2011/12/04/threadlocal-explained/). The entry objects within the table are WeakReferences themselves, i.e. can become null if the key = the threadLocal object bound to the thread is no longer referenced.
Currently the diff method does not correctly deal with it. I will first try to make an IT which does reliably fail for everyone and then try to come up with a fix. Thanks for reporting. Konrad > On 21. Sep 2017, at 10:48, Stefan Seifert <sseif...@pro-vision.de> wrote: > > Apache Sling Thread Support 3.2.8 > -> i've a problem running the unit tests. the run fine, up to rev. 1790774, > but fail from rev. 1791091 (SLING-6261). is it only on my machine? see below > > Apache Sling Scripting Core implementation 2.0.48 > +1 > > Apache Event Support 4.2.8 > +1 > > Apache Sling SlingStart Maven Plugin 1.7.10 > +1 > > Apache Sling JUnit Tests Teleporter 1.0.16 > +1 > > Apache Sling Testing Utilities 2.1.2 > +1 > > stefan > > > unit test errors in thread support 3.2.8: > > ------------------------------------------------------- > T E S T S > ------------------------------------------------------- > Running org.apache.sling.commons.threads.impl.ExtendedThreadFactoryTest > Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec - > in org.apache.sling.commons.threads.impl.ExtendedThreadFactoryTest > Running > org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocalsTest > Exception in thread "pool-9-thread-1" java.lang.NullPointerException > at > org.apache.sling.commons.threads.impl.ThreadLocalCleaner.changed(ThreadLocalCleaner.java:140) > at > org.apache.sling.commons.threads.impl.ThreadLocalCleaner.diff(ThreadLocalCleaner.java:104) > at > org.apache.sling.commons.threads.impl.ThreadLocalCleaner.cleanup(ThreadLocalCleaner.java:79) > at > org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocals.afterExecute(ThreadPoolExecutorCleaningThreadLocals.java:63) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1150) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > Exception in thread "pool-9-thread-2" java.lang.NullPointerException > at > org.apache.sling.commons.threads.impl.ThreadLocalCleaner.changed(ThreadLocalCleaner.java:140) > at > org.apache.sling.commons.threads.impl.ThreadLocalCleaner.diff(ThreadLocalCleaner.java:104) > at > org.apache.sling.commons.threads.impl.ThreadLocalCleaner.cleanup(ThreadLocalCleaner.java:79) > at > org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocals.afterExecute(ThreadPoolExecutorCleaningThreadLocals.java:63) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1150) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.192 sec <<< > FAILURE! - in > org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocalsTest > testThreadLocalBeingCleanedUp(org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocalsTest) > Time elapsed: 0.046 sec <<< FAILURE! > org.mockito.exceptions.verification.WantedButNotInvoked: > Wanted but not invoked: > listener.changed( > ADDED, > <any>, > java.lang.ThreadLocal@3632be31, > "test" > ); > -> at > org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocalsTest.testThreadLocalBeingCleanedUp(ThreadPoolExecutorCleaningThreadLocalsTest.java:60) > Actually, there were zero interactions with this mock. > > at > org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocalsTest.testThreadLocalBeingCleanedUp(ThreadPoolExecutorCleaningThreadLocalsTest.java:60) > > > Results : > > Failed tests: > ThreadPoolExecutorCleaningThreadLocalsTest.testThreadLocalBeingCleanedUp:60 > Wanted but not invoked: > listener.changed( > ADDED, > <any>, > java.lang.ThreadLocal@3632be31, > "test" > ); > -> at > org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocalsTest.testThreadLocalBeingCleanedUp(ThreadPoolExecutorCleaningThreadLocalsTest.java:60) > Actually, there were zero interactions with this mock. > > > Tests run: 6, Failures: 1, Errors: 0, Skipped: 0 > > > > >> -----Original Message----- >> From: Robert Munteanu [mailto:romb...@apache.org] >> Sent: Wednesday, September 20, 2017 2:57 PM >> To: dev@sling.apache.org >> Subject: [VOTE] Release Apache Sling Thread Support 3.2.8, Apache Sling >> Scripting Core implementation 2.0.48, Apache Event Support 4.2.8, Apache >> Sling SlingStart Maven Plugin 1.7.10, Apache Sling JUnit Tests Teleporter >> 1.0.16, Apache Sling Testing Utilities 2.1.2 >> >> Hi, >> >> This is a catch-all release vote for some modules I saw had changes but >> no releases. Due to a network hiccup they are split into 2 release >> repositories. >> >> There are 20 fixes included in these releases: >> >> - https://issues.apache.org/jira/browse/SLING/fixforversion/12335535 >> ( 5 issues ) >> - https://issues.apache.org/jira/projects/SLING/versions/12339953 ( >> 6 issues ) >> - https://issues.apache.org/jira/projects/SLING/versions/12341057 ( >> 2 issues ) >> - https://issues.apache.org/jira/projects/SLING/versions/12341406 ( >> 2 issues ) >> - https://issues.apache.org/jira/projects/SLING/versions/12341562 ( >> 1 issue ) >> - https://issues.apache.org/jira/projects/SLING/versions/12339140 ( >> 4 issues ) >> >> >> Staging repositories: >> - https://repository.apache.org/content/repositories/orgapachesling-1 >> 789 >> - - https://repository.apache.org/content/repositories/orgapachesli >> ng-1790 >> >> >> You can use this UNIX script to download the release and verify the >> signatures: >> http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh >> >> Usage: >> sh check_staged_release.sh 1789 /tmp/sling-staging >> sh check_staged_release.sh 1790 /tmp/sling-staging >> >> Please vote to approve this release: >> >> [ ] +1 Approve the release >> [ ] 0 Don't care >> [ ] -1 Don't release, because ... >> >> This majority vote is open for at least 72 hours. >> >> Thanks, >> >> Robert >