You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/04/28 03:26:18 UTC

[GitHub] [pulsar] codelipenghui commented on a diff in pull request #15361: [fix][txn] Topic transaction buffer recover don't close reader when throw RuntimeException

codelipenghui commented on code in PR #15361:
URL: https://github.com/apache/pulsar/pull/15361#discussion_r860440516


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/TopicTransactionBufferRecoverTest.java:
##########
@@ -486,7 +486,7 @@ public void testTransactionBufferRecoverThrowPulsarClientException() throws Exce
         TransactionBufferSnapshotService transactionBufferSnapshotServiceOriginal =
                 (TransactionBufferSnapshotService) field.get(getPulsarServiceList().get(0));
         // mock reader can't read snapshot fail
-        doThrow(new PulsarClientException("test")).when(reader).hasMoreEvents();
+        doThrow(new RuntimeException("test")).when(reader).hasMoreEvents();

Review Comment:
   ```suggestion
           doThrow(new Exception("test")).when(reader).hasMoreEvents();
   ```
   
   PulsarClientException is not a RuntimeException, If use RuntimeException here, we will lose the previous test coverage.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org