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

DeployCacheHandlerTest NPE due to server resourse cleanup

    XMLWordPrintable

Details

    • b08

    Backports

      Description

        > Andy: deployCacheHandlerTest - I have always gotten the 4 NPEs -
        >> NPE in TestNoDoubleUpdateCheck,
        >> NPE in TestNoUpdateCheckOnPendingBackgroundUpdate
        >> NPE in TestUpdateCheckForFirstAccess, and
        >> NPE in testUpdateCachingClientCodeDirectURLAccess
        >> all these are caused by setupServer failing and setting server=null after getting the exception:
        >> java.net.BindException: Address already in use: bind
        >> problem is that each of the test try to setup the server, and none of them try to clean up.
        >>
        >> Set server to null bypass server.shutDown() when tearDown(). Should replace this pattern/method
        >>
        >> private boolean setupServer(HttpHandler handler) {
        >>
        >> try {
        >> //setup own http server that
        >> server = new WebServer(port, handler);
        >> server.start();
        >> ....
        >>
        >> by simply calling WebServer.startServer() in setUp()
        >>
        >> protected void setUp() throws Exception {
        >> super.setUp();
        >> server = WebServer.startServer();
        >> }

        Attachments

          Issue Links

            Activity

              People

                yaow Yao Wang (Inactive)
                yaow Yao Wang (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: