Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-8747

ImpalaTestSuite::setup_class() can hit TypeError on HS2 connection setup failure

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      If we reach this exception handler in tests/common/impala_test_suite.py:

      try:
        cls.hs2_client = cls.create_impala_client(protocol='hs2')
      except Exception, e:
        # HS2 connection can fail for benign reasons, e.g. running with unsupported auth.
        LOG.info("HS2 connection setup failed, continuing...: {0}", e) <--------
      

      then it will fail with:

      Traceback (most recent call last):
        File "/usr/lib64/python2.7/logging/__init__.py", line 851, in emit
          msg = self.format(record)
        File "/usr/lib64/python2.7/logging/__init__.py", line 724, in format
          return fmt.format(record)
        File "/usr/lib64/python2.7/logging/__init__.py", line 464, in format
          record.message = record.getMessage()
        File "/usr/lib64/python2.7/logging/__init__.py", line 328, in getMessage
          msg = msg % self.args
      TypeError: not all arguments converted during string formatting

      The problem is that the statement uses "{0}" replacements that work with .format() while LOG.info is using "%" replacements.

      We can fix this by using .format ourselves or changing the message to use "%" codes.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            joemcdonnell Joe McDonnell
            joemcdonnell Joe McDonnell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment