Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8305847

Improve diagnosability and resilience of HttpClient::close tests

    XMLWordPrintable

Details

    • b19

    Description

      The HttpClient close tests could be improved to provide better diagnosis. The test makes some requests and register some dependent action to check the response state, followed by some dependent action that will read the request body (from an input stream). But if the first dependent action asserts, the body will not be read nor close, which will prevent HttpClient::close method, or the HttpClient::awaitTermination method, to terminate as expected, and the test will then later fail in timeout - either from jtreg or awaitTermination. This can be confusing for failure analysis. Also, the test executor - called 'readerService' in which dependent actions are executed should not be closed until all dependent actions have been submitted. Instead of having one such executor per test method, it would be simpler and more resilient to create it in `setup()` and close it in `teardown()`.

      Attachments

        Issue Links

          Activity

            People

              dfuchs Daniel Fuchs
              dfuchs Daniel Fuchs
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: