third_party/blink/tools/blinkpy/web_tests/controllers/manager.py
def _look_for_new_crash_logs(self, run_results, start_time):
        """Looks for and writes new crash logs, at the end of the test run.

        Since crash logs can take a long time to be written out if the system is
        under stress, do a second pass at the end of the test run.

        Args:
            run_results: The results of the test run.
            start_time: Time the tests started at. We're looking for crash
                logs after that time.
        """
        crashed_processes = []
        test_to_crash_failure = {}

        # reset static variables for Failure type classes
        test_failures.AbstractTestResultType.port = self._port
        test_failures.AbstractTestResultType.result_directory = self._results_directory
        test_failures.AbstractTestResultType.filesystem = self._filesystem

        for test, result in run_results.unexpected_results_by_name.items():
            if result.type != ResultType.Crash:
                continue
            for failure in result.failures:
                if (not isinstance(failure, test_failures.FailureCrash)
                        or failure.has_log):
                    continue
                crashed_processes.append(
                    [test, failure.process_name, failure.pid])
                test_to_crash_failure[test] = failure

        sample_files = self._port.look_for_new_samples(crashed_processes,
                                                       start_time) or {}
        for test, sample_file in sample_files.items():
            test_failures.AbstractTestResultType.test_name = test
            test_result = run_results.unexpected_results_by_name[test]
            artifact_relative_path = self._port.output_filename(
                test, test_failures.FILENAME_SUFFIX_SAMPLE, '.txt')
            artifacts_sub_dir = test_result.artifacts.ArtifactsSubDirectory()
            artifact_abspath = self._filesystem.join(self._results_directory,
                                                     artifacts_sub_dir,
                                                     artifact_relative_path)
            self._filesystem.maybe_make_directory(
                self._filesystem.dirname(artifact_abspath))
            self._filesystem.copyfile(sample_file, artifact_abspath)
            test_result.artifacts.AddArtifact(
                'sample_file',
                self._filesystem.join(artifacts_sub_dir,
                                      artifact_relative_path))

        new_crash_logs = self._port.look_for_new_crash_logs(
            crashed_processes, start_time) or {}
        for test, (crash_log, crash_site) in new_crash_logs.items():
            test_failures.AbstractTestResultType.test_name = test
            failure.crash_log = crash_log
            failure.has_log = self._port.output_contains_sanitizer_messages(
                failure.crash_log)
            test_result = run_results.unexpected_results_by_name[test]
            test_result.crash_site = crash_site
            test_to_crash_failure[test].create_artifacts(
                test_result.artifacts, force_overwrite=True)
Looks for and writes new crash logs, at the end of the test run.

        Since crash logs can take a long time to be written out if the system is
        under stress, do a second pass at the end of the test run.

        Args:
            run_results: The results of the test run.
            start_time: Time the tests started at. We're looking for crash
                logs after that time.
        
Looks for and writes new crash logs, at the end of the test run.
Since crash logs can take a long time to be written out if the system is
under stress, do a second pass at the end of the test run.
Looks for and writes new crash logs at the end of the test run . Since crash logs can take a long time to be written out if the system is under stress do a second pass at the end of the test run .
def _look_for_new_crash_logs(self, run_results, start_time):
        crashed_processes = []
        test_to_crash_failure = {}
        test_failures.AbstractTestResultType.port = self._port
        test_failures.AbstractTestResultType.result_directory = self._results_directory
        test_failures.AbstractTestResultType.filesystem = self._filesystem
        for test, result in run_results.unexpected_results_by_name.items():
            if result.type != ResultType.Crash:
                continue
            for failure in result.failures:
                if (not isinstance(failure, test_failures.FailureCrash)
                        or failure.has_log):
                    continue
                crashed_processes.append(
                    [test, failure.process_name, failure.pid])
                test_to_crash_failure[test] = failure
        sample_files = self._port.look_for_new_samples(crashed_processes,
                                                       start_time) or {}
        for test, sample_file in sample_files.items():
            test_failures.AbstractTestResultType.test_name = test
            test_result = run_results.unexpected_results_by_name[test]
            artifact_relative_path = self._port.output_filename(
                test, test_failures.FILENAME_SUFFIX_SAMPLE, '.txt')
            artifacts_sub_dir = test_result.artifacts.ArtifactsSubDirectory()
            artifact_abspath = self._filesystem.join(self._results_directory,
                                                     artifacts_sub_dir,
                                                     artifact_relative_path)
            self._filesystem.maybe_make_directory(
                self._filesystem.dirname(artifact_abspath))
            self._filesystem.copyfile(sample_file, artifact_abspath)
            test_result.artifacts.AddArtifact(
                'sample_file',
                self._filesystem.join(artifacts_sub_dir,
                                      artifact_relative_path))
        new_crash_logs = self._port.look_for_new_crash_logs(
            crashed_processes, start_time) or {}
        for test, (crash_log, crash_site) in new_crash_logs.items():
            test_failures.AbstractTestResultType.test_name = test
            failure.crash_log = crash_log
            failure.has_log = self._port.output_contains_sanitizer_messages(
                failure.crash_log)
            test_result = run_results.unexpected_results_by_name[test]
            test_result.crash_site = crash_site
            test_to_crash_failure[test].create_artifacts(
                test_result.artifacts, force_overwrite=True)
def _look_for_new_crash_logs ( self , run_results , start_time ) : crashed_processes = [ ] test_to_crash_failure = { } test_failures . AbstractTestResultType . port = self . _port test_failures . AbstractTestResultType . result_directory = self . _results_directory test_failures . AbstractTestResultType . filesystem = self . _filesystem for test , result in run_results . unexpected_results_by_name . items ( ) : if result . type != ResultType . Crash : continue for failure in result . failures : if ( not isinstance ( failure , test_failures . FailureCrash ) or failure . has_log ) : continue crashed_processes . append ( [ test , failure . process_name , failure . pid ] ) test_to_crash_failure [ test ] = failure sample_files = self . _port . look_for_new_samples ( crashed_processes , start_time ) or { } for test , sample_file in sample_files . items ( ) : test_failures . AbstractTestResultType . test_name = test test_result = run_results . unexpected_results_by_name [ test ] artifact_relative_path = self . _port . output_filename ( test , test_failures . FILENAME_SUFFIX_SAMPLE , '.txt' ) artifacts_sub_dir = test_result . artifacts . ArtifactsSubDirectory ( ) artifact_abspath = self . _filesystem . join ( self . _results_directory , artifacts_sub_dir , artifact_relative_path ) self . _filesystem . maybe_make_directory ( self . _filesystem . dirname ( artifact_abspath ) ) self . _filesystem . copyfile ( sample_file , artifact_abspath ) test_result . artifacts . AddArtifact ( 'sample_file' , self . _filesystem . join ( artifacts_sub_dir , artifact_relative_path ) ) new_crash_logs = self . _port . look_for_new_crash_logs ( crashed_processes , start_time ) or { } for test , ( crash_log , crash_site ) in new_crash_logs . items ( ) : test_failures . AbstractTestResultType . test_name = test failure . crash_log = crash_log failure . has_log = self . _port . output_contains_sanitizer_messages ( failure . crash_log ) test_result = run_results . unexpected_results_by_name [ test ] test_result . crash_site = crash_site test_to_crash_failure [ test ] . create_artifacts ( test_result . artifacts , force_overwrite = True )
Looks for and writes new crash logs, at the end of the test run.
Looks for and writes new crash logs at the end of the test run .
"""Looks for and writes new crash logs, at the end of the test run.

        Since crash logs can take a long time to be written out if the system is
        under stress, do a second pass at the end of the test run.

        Args:
            run_results: The results of the test run.
            start_time: Time the tests started at. We're looking for crash
                logs after that time.
        """ # reset static variables for Failure type classes
self
run_results
The results of the test run.
The results of the test run .
start_time
Time the tests started at. We're looking for crash
logs after that time.
Time the tests started at . We ' re looking for crash logs after that time .