diff options
author | mseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-26 04:28:30 +0000 |
---|---|---|
committer | mseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-26 04:28:30 +0000 |
commit | 3028de1055973c57b8da90fa05515a23b9299977 (patch) | |
tree | 6b47ce7e7d4e3c540b1ab77e99f74b80038e67ba /ppapi | |
parent | a42d346e1bbd53215d602c3cdeb96c8f40936689 (diff) | |
download | chromium_src-3028de1055973c57b8da90fa05515a23b9299977.zip chromium_src-3028de1055973c57b8da90fa05515a23b9299977.tar.gz chromium_src-3028de1055973c57b8da90fa05515a23b9299977.tar.bz2 |
Breakpad test: Add sanity check to ensure crash dump files aren't empty
It's possible that the "missing .txt file" flake is occurring because
MiniDumpWriteDump() fails, in which case we might see an empty .dmp
file.
BUG=169394
TEST=run_breakpad_browser_process_crash_test in nacl_integration
Review URL: https://codereview.chromium.org/12075002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179031 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rwxr-xr-x | ppapi/native_client/tests/breakpad_crash_test/crash_dump_tester.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/ppapi/native_client/tests/breakpad_crash_test/crash_dump_tester.py b/ppapi/native_client/tests/breakpad_crash_test/crash_dump_tester.py index d0eaa05..63d67f1 100755 --- a/ppapi/native_client/tests/breakpad_crash_test/crash_dump_tester.py +++ b/ppapi/native_client/tests/breakpad_crash_test/crash_dump_tester.py @@ -73,7 +73,8 @@ def GetDumpFiles(dumps_dirs): for filename in ListPathsInDir(dumps_dir)] sys.stdout.write('crash_dump_tester: Found %i files\n' % len(all_files)) for dump_file in all_files: - sys.stdout.write(' %s\n' % dump_file) + sys.stdout.write(' %s (size %i)\n' + % (dump_file, os.stat(dump_file).st_size)) return [dump_file for dump_file in all_files if dump_file.endswith('.dmp')] @@ -162,10 +163,17 @@ def Main(cleanup_funcs): if len(dmp_files) != options.expected_crash_dumps: sys.stdout.write(msg) failed = True - # On Windows, the crash dumps should come in pairs of a .dmp and - # .txt file. - if sys.platform == 'win32': - for dump_file in dmp_files: + + for dump_file in dmp_files: + # Sanity check: Make sure dumping did not fail after opening the file. + msg = 'crash_dump_tester: ERROR: Dump file is empty\n' + if os.stat(dump_file).st_size == 0: + sys.stdout.write(msg) + failed = True + + # On Windows, the crash dumps should come in pairs of a .dmp and + # .txt file. + if sys.platform == 'win32': second_file = dump_file[:-4] + '.txt' msg = ('crash_dump_tester: ERROR: File %r is missing a corresponding ' '%r file\n' % (dump_file, second_file)) |