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

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

Issue 2645963004: Buildbot: Only archive core dumps from unexpected crashes. (Closed)
Patch Set: 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 | « no previous file | tools/utils.py » ('j') | tools/utils.py » ('J')
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 d1af50c408c5fd3c8f0af620cdb3b4f9c0feca78..86557937fdaec5f5437607af3908dad2b47d0cf2 100644
--- a/tools/testing/dart/test_progress.dart
+++ b/tools/testing/dart/test_progress.dart
@@ -316,7 +316,7 @@ class TestOutcomeLogWriter extends EventListener {
}
class UnexpectedCrashDumpArchiver extends EventListener {
- final archivedBinaries = new Set<String>();
+ final archivedBinaries = <String, String>{};
void done(TestCase test) {
if (test.unexpectedOutput &&
@@ -335,16 +335,27 @@ class UnexpectedCrashDumpArchiver extends EventListener {
final binName = lastCommand.executable;
final binFile = new File(binName);
final binBaseName = new Path(binName).filename;
- if (archivedBinaries.contains(binBaseName)) {
- return;
- }
-
- if (binFile.existsSync()) {
+ if (!archivedBinaries.containsKey(binName) &&
+ binFile.existsSync()) {
final mode = test.configuration['mode'];
final arch = test.configuration['arch'];
- TestUtils.copyFile(new Path(binName),
- new Path("core.${mode}_${arch}_${binBaseName}"));
- archivedBinaries.add(binBaseName);
+ final archived = "binary.${mode}_${arch}_${binBaseName}";
+ TestUtils.copyFile(new Path(binName), new Path(archived));
+ archivedBinaries[binName] = archived;
+ }
+
+ if (archivedBinaries.containsKey(binName)) {
+ // We have found and copied the binary.
+ var coredumpsList;
+ try {
+ coredumpsList =
+ new File('coredumps').openSync(mode: FileMode.APPEND);
kustermann 2017/01/20 14:56:55 Instead of doing this for every test, how about op
Vyacheslav Egorov (Google) 2017/01/20 16:44:45 I wanted to do it for each test so that even if te
+ coredumpsList.writeStringSync(
+ "${test.displayName},${name},${archivedBinaries[binName]}\n");
+ } finally {
+ if (coredumpsList != null)
kustermann 2017/01/20 14:56:55 You could as well move the 'new File(...') out of
Vyacheslav Egorov (Google) 2017/01/20 16:44:45 I wanted to catch and ignore exceptions from openS
+ coredumpsList.close();
+ }
}
}
}
« no previous file with comments | « no previous file | tools/utils.py » ('j') | tools/utils.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698