Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-20543

Fix the flaky TestThriftHttpServer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha-1
    • 3.0.0-alpha-1, 2.1.0
    • None
    • None
    • Reviewed

    Description

      The runThriftServer() in TestThriftHttpServer, we have the following :

      private void runThriftServer(int customHeaderSize) throws Exception {
      //......
          startHttpServerThread(args.toArray(new String[args.size()]));
      
          // wait up to 10s for the server to start
          for (int i = 0; i < 100
              && (thriftServer.serverRunner == null ||  thriftServer.serverRunner.httpServer ==
              null); i++) {
            Thread.sleep(100);
          }
      //......
            checkHttpMethods(url);
      //......
      }
      

      The port may still not open even if the thriftServer.serverRunner != null and thriftServer.serverRunner.httpServer != null, so the checkHttpMethods will get a connection refused ...

      We should wait till the port is really listening....

      Attachments

        1. HBASE-20543.v1.patch
          3 kB
          Zheng Hu

        Activity

          People

            openinx Zheng Hu
            openinx Zheng Hu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: