Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
utils.BaseCoreDumpArchiver Class Reference
Inheritance diagram for utils.BaseCoreDumpArchiver:
utils.PosixCoreDumpArchiver utils.WindowsCoreDumpArchiver utils.LinuxCoreDumpArchiver utils.MacOSCoreDumpArchiver

Public Member Functions

def __init__ (self, search_dir, output_directory)
 
def __enter__ (self)
 
def __exit__ (self, *_)
 

Detailed Description

This class reads coredumps file written by UnexpectedCrashDumpArchiver
into the current working directory and uploads all cores and binaries
listed in it into Cloud Storage (see
pkg/test_runner/lib/src/test_progress.dart).

Definition at line 610 of file utils.py.

Constructor & Destructor Documentation

◆ __init__()

def utils.BaseCoreDumpArchiver.__init__ (   self,
  search_dir,
  output_directory 
)

Reimplemented in utils.LinuxCoreDumpArchiver, utils.MacOSCoreDumpArchiver, utils.WindowsCoreDumpArchiver, and utils.PosixCoreDumpArchiver.

Definition at line 620 of file utils.py.

620 def __init__(self, search_dir, output_directory):
621 self._bucket = 'dart-temp-crash-archive'
622 self._binaries_dir = os.getcwd()
623 self._search_dir = search_dir
624 self._output_directory = output_directory
625

Member Function Documentation

◆ __enter__()

def utils.BaseCoreDumpArchiver.__enter__ (   self)

Definition at line 633 of file utils.py.

633 def __enter__(self):
634 print('INFO: Core dump archiving is activated')
635
636 # Cleanup any stale files
637 if self._safe_cleanup():
638 print('WARNING: Found and removed stale coredumps')
639
def print(*args, **kwargs)
Definition: run_tests.py:49

◆ __exit__()

def utils.BaseCoreDumpArchiver.__exit__ (   self,
_ 
)

Reimplemented in utils.WindowsCoreDumpArchiver.

Definition at line 640 of file utils.py.

640 def __exit__(self, *_):
641 try:
642 crashes = self._find_unexpected_crashes()
643 if crashes:
644 # If we get a ton of crashes, only archive 10 dumps.
645 archive_crashes = crashes[:10]
646 print('Archiving coredumps for crash (if possible):')
647 for crash in archive_crashes:
648 print('----> {}'.format(crash))
649
650 sys.stdout.flush()
651
652 self._archive(archive_crashes)
653 else:
654 print('INFO: No unexpected crashes recorded')
655 dumps = self._find_all_coredumps()
656 if dumps:
657 print('INFO: However there are {} core dumps found'.format(
658 len(dumps)))
659 for dump in dumps:
660 print('INFO: -> {}'.format(dump))
661 print()
662 except Exception as error:
663 print('ERROR: Failed to archive crashes: {}'.format(error))
664 raise
665
666 finally:
667 self._safe_cleanup()
668
uint32_t uint32_t * format

The documentation for this class was generated from the following file: