Meego Wiki
Views

Quality/QA-tools/OTS/DeveloperDocs/ErrorSituations

From MeeGo wiki
< Quality | QA-tools | OTS | DeveloperDocs
Revision as of 14:16, 29 December 2010 by Tvainio (Talk | contribs)
Jump to: navigation, search

Contents

OTS 0.1 Error Situations

OTS 0.1 has 2 ways of handling error information. The testrun has a specific "set_error_info() and set_error_code()" mechanism for critical errors. This is the main mechanism. In addition to that error messages are printed to http log. The error info mechanism is a legacy thing from the old days we didn't have global http logging or amqp.

In OTS 0.8 we have the same http logging. The set_error_info() stuff is gone but it is replaced by exceptions that can be sent over the wire with amqp.

Critical Errors

These cause the testrun to end with result ERROR

/ots/common/results/resultjudge.py:169:

	self.testrun.set_error_info("No test packages defined nor found.")
  • Raised if user didn't specify test packages and conductor couldn't found any.
  • This should practically never happen. Conductor should raise other errors before this if image does not contain packages.

/ots/common/results/resultjudge.py:179:

self.testrun.set_error_info("Results missing from: %s" \
  • Raised if server didn't receive results.xml for all testpackages this.
  • This can happen for example if global timeout happens. (Conductor detects timeouts and raises Timeout error so this shouldn't happen anymore?)

/ots/server/testrun_host/testrun_host.py:252:

        try:
            return ots_config.default_options[sw_product]
        except (KeyError, ValueError):
            raise Exception("Unknown sw_product %s" % sw_product)
  • Raised if user tries to use sw product that is not defined in the config file
  • System test: log_tests.TestErrorConditions.test_non_existing_devicegroup

/ots/server/testrun_host/testrun_host.py:392:

        for package in test_packages:
            if not (package.endswith("-tests")\
            or package.endswith("-test")\
            or package.endswith("-benchmark")):
                invalid_packages.append(package)
  • error_msg = "Invalid testpackage(s): %s" % invalid_packages
  • This is raised if user input contains test packages that do not end -test, -tests, -benchmark
  • System test: log_tests.TestErrorConditions.test_bad_testpackage_names

/ots/server/testrun_host/testrun_host.py:410:

        if not (self.testrun.get_rootstrap_url() \
                    or self.testrun.get_image_url()):
  • error_msg = "No image url or rootstrap url defined."
  • Raised if image url is not defined in input. (rootstrap is deprecated!)
  • System test: log_tests.TestErrorConditions.test_no_image_url

/ots/server/testrun_host/testrun_host.py:420:

        if not self.testrun.get_image_url() and \
                self.testrun.get_host_testpackages():

            error_msg = "Image url missing. Executing host based tests "+\
                        "requires image url."
  • Deprecated! Image url is mandatory always so this will never happen. The previous error will be raised first.


/ots/server/testrun_host/testrun_host.py:443:

        valid_values = ['default', 'perpackage']
        for model in custom_models:
            valid_values.append(model[0])
        model = self.testrun.get_option('distribution_model')

        if model not in valid_values:
  • error_msg = "Invalid distribution model: %s" % model
  • Raised if user gives unknown distribution model parameter. (Extension points can introduce custom distribution models in addition to the default values shown.)
  • System test: log_tests.TestErrorConditions.test_bad_distribution_model

/ots/server/testrun_host/testrun_host.py:451:

        if model == 'perpackage' and len(self.testrun.get_testpackages()) == 0:
            error_msg = "Test packages must be defined for specified "\
                        +"distribution model '%s'" % model

  • Raised if user tries to use perpackage distribution model but does not explicitly specify testpackages.

/ots/server/conductorengine/conductorengine.py:168:

        except OtsQueueDoesNotExistError:
            error_info = "Queue '%s' does not exist" \
                % (self._routing_key)
  • Raised if requested worker queue is not available in amqp server. (No suitable workers have ever been added to the system)
  • System test: log_tests.TestErrorConditions.test_non_existing_devicegroup

/ots/server/conductorengine/conductorengine.py:176:


            error_info = ("Server side timeout. (Worker went offline during "+\
                              "testrun or some tasks were not started in time)")
  • Raised if server side global timeout is hit. See timeouts section in wiki for more details.
  • This should be very rare. (but might still happen)

/ots/server/conductorengine/conductorengine.py:182:

        except OtsConnectionError:
            error_info = "A connectivity issue was encountered"
  • Raised if amqp connection fails
  • Should be very rare

/ots/server/conductorengine/conductorengine.py:190:

        except OtsQueueTimeoutError, exception:
            error_info = ("The job was not started within %s minutes. "+\
                "A worker in that devicegroup may be down or there may be "+\
                "exceptional demand") % str(exception.timeout_length / 60)
  • Queue timeout. Raised if a worker does not take the task from the queue in time.

/ots/server/conductorengine/conductorengine.py:196:

        except Exception:
            error_info = "A miscellaneous error was encountered"

  • Generic ots distributor error. This is bad!

/ots/worker/conductor/executor.py:277:

    def _test_execution_error_handler(self, error_info, error_code):
        """
        Handler for testrun timed out errors and ConductorError exceptions
        that are raised during test execution.
        """
        self.log.error("Test execution error: %s " % error_info)
        if not self.stand_alone:
            self.responseclient.set_error(error_info, error_code)
  • Generic conductor test execution & timeout handler.
  • More detailed analysis is part of ots 0.9. For 0.8 just make sure these are sent to server and communicated to user properly.
  • System test: log_tests.TestErrorConditions.test_timeout

/ots/worker/conductor/conductor.py:371:

    except ConductorError, exc:
        log.error("%s (ots error code: %s)" % (exc.error_info, exc.error_code))
        if not stand_alone:
            responseclient.set_error(exc.error_info, exc.error_code)
  • Generic conductor exception handler.
  • More detailed analysis is part of ots 0.9. For 0.8 just make sure these are sent to server and communicated to user properly.

/ots/worker/conductor/conductor.py:378:

    except:
        log.error("Unknown error when trying to execute tests.")
        log.error("Traceback follows:", exc_info = True)
        if not stand_alone:
            responseclient.set_error(str(sys.exc_info()[1]), "999")
  • Conductor last resport try-except.

/ots.worker/ots/worker/task_broker.py:206:

        try:
            self._dispatch(command)

        except (CommandFailed):
            LOGGER.error("Process failed")
            error_info = "Task execution failed"
  • Raised if the task command process (=conductor) returns something else than 0.

Noncritical Errors

These produce an error message to log but do not affect the testrun result. These should be warnings.

/ots.server/ots/server/testrun_host/testrun_host.py:185:

        try:
            if not ots_config.debug_mode:
                for text, url in self.testrun.get_result_links():
                    self.input_plugin.store_url(url, text)
        except:
              self.log.error("Publishing result url failed. "\
                           "Traceback follows:", exc_info = True)
  • OTS tries to publish the result url with input plugin and fails.

/ots.server/ots/server/testrun_host/testrun_host.py:192:

        try:
            if self.testrun.email_enabled() and self.emailbackend:
                self.emailbackend.send_mail()
           self.log.error("Sending result email failed. Traceback follows:", 
  • OTS fails to send result email

/ots.server/ots/server/testrun_host/testrun_host.py:269:

        self.log.info("Publishing testrun log link")
        try:
            if not ots_config.debug_mode:
                self.input_plugin.store_url(url, text)
        except:
           self.log.error("Publishing testrun log link failed. "\
                           "Traceback follows:", exc_info = True)

  • Another input plugin warning

/ots.server/ots/server/testrun_host/testrun_host.py:461:

        try:
            target_packages = self.input_plugin.get_changed_packages(build_id)
        except:
            self.log.error("Getting target packages failed. "\
                           "Traceback follows:", exc_info = True)
            target_packages = []
  • OTS tries to fetch information about the target packages changed in the build request and fails.

/ots.server/ots/server/email_backend/mailmessage.py:145:

        try:
            attach_as_zip_file(msg, result_files, unique_id)
        except:
            LOG.error("Something went wrong when creating email attachment. "\
                      "Traceback follows:", exc_info = True)
  • Creating the attachment zip package failed.

/ots.server/ots/server/email_backend/email_backend.py:92:

        if not (type(to_address_list) == type(list()) \
                or type(to_address_list) == type("")):
            self.log.error("Error in sending mail: expected list or string in "\
                           "to_address_list: %s " % str(to_address_list))
            return
  • Bad email address input

/ots.server/ots/server/email_backend/email_backend.py:121:

 self.log.error("Error in sending mail to following addresses:")
 self.log.error(str(failed_addresses)) 

/ots.qareports_plugin/ots/qareports_plugin/qareports_client.py:60:

      LOG.error("Upload failed. Server returned: %s" % response)
  • Failed to send test results to Meego QA Reports reporting tool.
Personal tools