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

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

Issue 2645963004: Buildbot: Only archive core dumps from unexpected crashes. (Closed)
Patch Set: Address Martin's 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 | « no previous file | 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 d1af50c408c5fd3c8f0af620cdb3b4f9c0feca78..7e57a60839ce79486673eeaddc09df779257a181 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,33 @@ 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);
+ coredumpsList.writeStringSync(
+ "${test.displayName},${name},${archivedBinaries[binName]}\n");
+ } catch (e) {
+ print('Failed to add crash to coredumps list: ${e}');
+ } finally {
+ try {
+ if (coredumpsList != null)
+ coredumpsList.closeSync();
+ } catch (e) {
+ print('Failed to close coredumps list: ${e}');
+ }
+ }
}
}
}
« no previous file with comments | « no previous file | tools/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698