[
https://issues.apache.org/jira/browse/GEODE-9421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17378971#comment-17378971
]
ASF subversion and git services commented on GEODE-9421:
--------------------------------------------------------
Commit d361a99806df0bda6da886bd142bd71ff4ad504b in geode's branch
refs/heads/develop from Alberto Gomez
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=d361a99 ]
GEODE-9421: Remove BatchRemoval NPE logs from JUnit tests (#6683)
ParallelAsyncEventQueueImplTest and ParallelGatewaySenderImplTest classes were
mocking InternalRegion
but were not providing an implementation for cache.getCancelCriterion().
This led to a null pointer exception in the BatchRemoval thread code that,
even though it did not affect the tests, provoked that a log message with
a null pointer exception was printed.
The solution consists of adding a response in the mock using when() for the
cache.getCancelCriterion() method.
> Remove ParallelGatewaySenderQueue$BatchRemovalThread NPE logs when running
> JUnit tests
> --------------------------------------------------------------------------------------
>
> Key: GEODE-9421
> URL: https://issues.apache.org/jira/browse/GEODE-9421
> Project: Geode
> Issue Type: Improvement
> Components: tests
> Reporter: Alberto Gomez
> Assignee: Alberto Gomez
> Priority: Major
> Labels: pull-request-available
>
> The ouput of the run of the CI sometimes shows the following NPE logs:
> Exception in thread "BatchRemovalThread for GatewaySender_sender_0"
> java.lang.NullPointerException
> at
> org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderQueue$BatchRemovalThread.checkCancelled(ParallelGatewaySenderQueue.java:1841)
> at
> org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderQueue$BatchRemovalThread.run(ParallelGatewaySenderQueue.java:1942)
> Exception in thread "BatchRemovalThread for GatewaySender_sender_4"
> java.lang.NullPointerException
> at
> org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderQueue$BatchRemovalThread.checkCancelled(ParallelGatewaySenderQueue.java:1841)
> at
> org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderQueue$BatchRemovalThread.run(ParallelGatewaySenderQueue.java:1942)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)