nicoloboschi opened a new pull request #12347:
URL: https://github.com/apache/pulsar/pull/12347


   ### Motivation
   `ElasticSearchClientTests#testBulkRetry` sometimes fails due to this error
   
   ```
   java.lang.AssertionError: expected [2] but found [3]
        at org.testng.Assert.fail(Assert.java:99)
        at org.testng.Assert.failNotEquals(Assert.java:1037)
        at org.testng.Assert.assertEqualsImpl(Assert.java:140)
        at org.testng.Assert.assertEquals(Assert.java:122)
        at org.testng.Assert.assertEquals(Assert.java:797)
        at org.testng.Assert.assertEquals(Assert.java:807)
        at 
org.apache.pulsar.io.elasticsearch.ElasticSearchClientTests.testBulkRetry(ElasticSearchClientTests.java:207)
   ```
   
   ### Modifications
   
   - The reason why the test fail is that the background bulk thread does some 
flush at certain intervals. In this tests we wants to check the explicit 
`flush()` method, so I disabled the periodic flusher thread
   - Fixed leaks in ElasticSearchClientTests test class where tests weren't 
calling `ElasticSearchClient#close()` method, so some daemon threads never stop 
until the java process has been done
   
   ### Verifying this change
   
   This change is a trivial rework / code cleanup without any 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to