Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: tools/testing/dart/test_progress.dart

Issue 2644593002: Buildbot: Change --copy-crashdumps to do the actual archiving to CloudStorage. (Closed)
Patch Set: Address comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/test.py ('k') | tools/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7751d63677c5c0c49edb19336d21a68bf8944abd 100644
--- a/tools/testing/dart/test_progress.dart
+++ b/tools/testing/dart/test_progress.dart
@@ -316,25 +316,32 @@ 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();
+ 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.${mode}_${arch}_${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");
+ final mode = test.configuration['mode'];
+ final arch = test.configuration['arch'];
+ TestUtils.copyFile(new Path(binName),
+ new Path("core.${mode}_${arch}_${binBaseName}"));
+ archivedBinaries.add(binBaseName);
}
}
}
« no previous file with comments | « tools/test.py ('k') | tools/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698