Chromium Code Reviews| Index: tools/testing/dart/test_progress.dart |
| diff --git a/tools/testing/dart/test_progress.dart b/tools/testing/dart/test_progress.dart |
| index 6eb4babd0732a23955adbcc4fadb7e1792acc5ce..3557f72defba8b3a5397388b92e2aa33b7f94dc5 100644 |
| --- a/tools/testing/dart/test_progress.dart |
| +++ b/tools/testing/dart/test_progress.dart |
| @@ -316,25 +316,30 @@ class TestOutcomeLogWriter extends EventListener { |
| } |
| class UnexpectedCrashDumpArchiver extends EventListener { |
| + final archivedBinaries = new Set<String>(); |
| + |
| void done(TestCase test) { |
| if (test.unexpectedOutput && test.result == Expectation.CRASH) { |
| - var name = "core.dart.${test.lastCommandOutput.pid}"; |
| - var file = new File(name); |
| - if (file.existsSync()) { |
| - // Find the binary - we assume this is the first part of the command |
| - var binName = test.lastCommandExecuted.toString().split(' ').first; |
| - var binFile = new File(binName); |
| - var binBaseName = new Path(binName).filename; |
| + final name = "core.${test.lastCommandOutput.pid}"; |
| + final file = new File(name); |
| + final exists = file.existsSync(); |
| + print("\nLooking for a core dump ${name}: ${exists ? '' : 'not'} found"); |
|
kustermann
2017/01/18 17:12:35
Maybe remove this line?
Vyacheslav Egorov (Google)
2017/01/18 19:56:59
Done.
|
| + if (exists) { |
| + // We have a coredump for the process. This coredump will be archived by |
| + // CoreDumpArchiver (see tools/utils.py). For debugging purposes we |
| + // need to archive the crashed binary as well. To simplify the |
| + // archiving code we simply copy binaries into current folder next to |
| + // core dumps and name them `core.$binary_name`. |
| + final binName = test.lastCommandExecuted.executable; |
| + final binFile = new File(binName); |
| + final binBaseName = new Path(binName).filename; |
| + if (archivedBinaries.contains(binBaseName)) { |
| + return; |
| + } |
| + |
| if (binFile.existsSync()) { |
| - var tmpPath = new Path(Directory.systemTemp.path); |
| - var dir = new Path(TestUtils |
| - .mkdirRecursive( |
| - tmpPath, new Path('coredump_${test.lastCommandOutput.pid}')) |
| - .path); |
| - TestUtils.copyFile(new Path(name), dir.append(name)); |
| - TestUtils.copyFile(new Path(binName), dir.append(binBaseName)); |
| - print("\nCopied core dump and binary for unexpected crash to: " |
| - "$dir"); |
| + TestUtils.copyFile(new Path(binName), new Path("core.${binBaseName}")); |
|
kustermann
2017/01/18 17:12:35
Consider making binBaseName contain the configurat
Vyacheslav Egorov (Google)
2017/01/18 19:56:59
Done.
Bill Hesse
2017/01/24 16:01:21
On buildbots, we often test modes separately, but
|
| + archivedBinaries.add(binBaseName); |
| } |
| } |
| } |