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

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

Issue 2692883002: Enable support for coredump archiving on windows (Closed)
Patch Set: Addressed comments Created 3 years, 10 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/testing/dart/test_configurations.dart ('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 c029fc06f4f2fbaa62165fb32b540aa7a986d2ab..9baa97f48971172a0085b22ac4f8b145413da1a7 100644
--- a/tools/testing/dart/test_progress.dart
+++ b/tools/testing/dart/test_progress.dart
@@ -313,52 +313,53 @@ class TestOutcomeLogWriter extends EventListener {
}
}
-class UnexpectedCrashDumpArchiver extends EventListener {
+class UnexpectedCrashLogger extends EventListener {
final archivedBinaries = <String, String>{};
void done(TestCase test) {
if (test.unexpectedOutput &&
test.result == Expectation.CRASH &&
test.lastCommandExecuted is ProcessCommand) {
- final name = "core.${test.lastCommandOutput.pid}";
- final file = new File(name);
- final exists = file.existsSync();
- if (exists) {
- final lastCommand = test.lastCommandExecuted as ProcessCommand;
- // 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 = lastCommand.executable;
- final binFile = new File(binName);
- final binBaseName = new Path(binName).filename;
- if (!archivedBinaries.containsKey(binName) &&
- binFile.existsSync()) {
- final mode = test.configuration['mode'];
- final arch = test.configuration['arch'];
- final archived = "binary.${mode}_${arch}_${binBaseName}";
- TestUtils.copyFile(new Path(binName), new Path(archived));
- archivedBinaries[binName] = archived;
- }
+ final pid = "${test.lastCommandOutput.pid}";
+ final lastCommand = test.lastCommandExecuted as ProcessCommand;
+
+ // We might 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
+ // `binary.${mode}_${arch}_${binary_name}`.
+ final binName = lastCommand.executable;
+ final binFile = new File(binName);
+ final binBaseName = new Path(binName).filename;
+ if (!archivedBinaries.containsKey(binName) &&
+ binFile.existsSync()) {
+ final mode = test.configuration['mode'];
+ final arch = test.configuration['arch'];
+ 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;
+ if (archivedBinaries.containsKey(binName)) {
+ // We have found and copied the binary.
+ var unexpectedCrashesFile;
+ try {
+ unexpectedCrashesFile =
+ new File('unexpected-crashes').openSync(mode: FileMode.APPEND);
+ unexpectedCrashesFile.writeStringSync(
+ "${test.displayName},${pid},${archivedBinaries[binName]}\n");
+ } catch (e) {
+ print('Failed to add crash to unexpected-crashes list: ${e}');
+ } finally {
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}');
+ if (unexpectedCrashesFile != null) {
+ unexpectedCrashesFile.closeSync();
}
+ } catch (e) {
+ print('Failed to close unexpected-crashes file: ${e}');
}
}
}
« no previous file with comments | « tools/testing/dart/test_configurations.dart ('k') | tools/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698