RFR: 8314136: Test java/net/httpclient/CancelRequestTest.java failed: WARNING: tracker for HttpClientImpl(42) has outstanding operations

Daniel Fuchs dfuchs at openjdk.org
Thu Sep 14 19:18:47 UTC 2023


On Fri, 11 Aug 2023 13:24:08 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> Please find here a patch for a very rare intermittent failure observed in CancelRequestTest.
> 
> The fact that the number of pending requests hasn't been decremented leads me to think that completable future returned by sendAsync (called from send) hasn't been fully completed. That is, the dependent actions registered by sendAsync have not been run within the timeout waiting for the number of pending requests to reach 0.
> 
> The fix is to call cf.get() again after calling cf.cancel(), and increase the timeout waiting for cleanup in testPostInterrupt.
> client.close() is also called at the end of each test method to reclaim resources earlier

Coming back to this finally. I reverted the changes to HttpClientImpl.java.
What remains are changes to the CancelRequestTest. Most of these are cleanup suggested by the IDE, the important part are the two lines added at the end of the test methods:


        assert client != null;
        if (!sameClient) client.close();

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15249#issuecomment-1720005332


More information about the net-dev mailing list