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

Side by Side Diff: pkg/analysis_server/benchmark/perf/memory_tests.dart

Issue 2413573003: Replace expect() with outOfTestExpect() in Analysis Server performance benchmark. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:math'; 8 import 'dart:math';
9 9
10 import 'package:analysis_server/plugin/protocol/protocol.dart'; 10 import 'package:analysis_server/plugin/protocol/protocol.dart';
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 Future setUp() { 58 Future setUp() {
59 onAnalysisErrors.listen((AnalysisErrorsParams params) { 59 onAnalysisErrors.listen((AnalysisErrorsParams params) {
60 currentAnalysisErrors[params.file] = params.errors; 60 currentAnalysisErrors[params.file] = params.errors;
61 }); 61 });
62 onServerError.listen((ServerErrorParams params) { 62 onServerError.listen((ServerErrorParams params) {
63 // A server error should never happen during an integration test. 63 // A server error should never happen during an integration test.
64 fail('${params.message}\n${params.stackTrace}'); 64 fail('${params.message}\n${params.stackTrace}');
65 }); 65 });
66 Completer serverConnected = new Completer(); 66 Completer serverConnected = new Completer();
67 onServerConnected.listen((_) { 67 onServerConnected.listen((_) {
68 expect(serverConnected.isCompleted, isFalse); 68 outOfTestExpect(serverConnected.isCompleted, isFalse);
69 serverConnected.complete(); 69 serverConnected.complete();
70 }); 70 });
71 return startServer(servicesPort: vmServicePort).then((_) { 71 return startServer(servicesPort: vmServicePort).then((_) {
72 server.listenToOutput(dispatchNotification); 72 server.listenToOutput(dispatchNotification);
73 server.exitCode.then((_) { 73 server.exitCode.then((_) {
74 skipShutdown = true; 74 skipShutdown = true;
75 }); 75 });
76 return serverConnected.future; 76 return serverConnected.future;
77 }); 77 });
78 } 78 }
(...skipping 23 matching lines...) Expand all
102 /** 102 /**
103 * 1. Start Analysis Server. 103 * 1. Start Analysis Server.
104 * 2. Set the analysis [roots]. 104 * 2. Set the analysis [roots].
105 * 3. Wait for analysis to complete. 105 * 3. Wait for analysis to complete.
106 * 4. Record the heap size after analysis is finished. 106 * 4. Record the heap size after analysis is finished.
107 * 5. Shutdown. 107 * 5. Shutdown.
108 * 6. Go to (1). 108 * 6. Go to (1).
109 */ 109 */
110 static Future<List<int>> start_waitInitialAnalysis_shutdown( 110 static Future<List<int>> start_waitInitialAnalysis_shutdown(
111 {List<String> roots, int numOfRepeats}) async { 111 {List<String> roots, int numOfRepeats}) async {
112 expect(roots, isNotNull, reason: 'roots'); 112 outOfTestExpect(roots, isNotNull, reason: 'roots');
113 expect(numOfRepeats, isNotNull, reason: 'numOfRepeats'); 113 outOfTestExpect(numOfRepeats, isNotNull, reason: 'numOfRepeats');
114 // Repeat. 114 // Repeat.
115 List<int> sizes = <int>[]; 115 List<int> sizes = <int>[];
116 for (int i = 0; i < numOfRepeats; i++) { 116 for (int i = 0; i < numOfRepeats; i++) {
117 AnalysisServerMemoryUsageTest test = new AnalysisServerMemoryUsageTest(); 117 AnalysisServerMemoryUsageTest test = new AnalysisServerMemoryUsageTest();
118 // Initialize Analysis Server. 118 // Initialize Analysis Server.
119 await test.setUp(); 119 await test.setUp();
120 await test.subscribeToStatusNotifications(); 120 await test.subscribeToStatusNotifications();
121 // Set roots and analyze. 121 // Set roots and analyze.
122 await test.sendAnalysisSetAnalysisRoots(roots, []); 122 await test.sendAnalysisSetAnalysisRoots(roots, []);
123 await test.analysisFinished; 123 await test.analysisFinished;
124 sizes.add(test.getMemoryUsage()); 124 sizes.add(test.getMemoryUsage());
125 // Stop the server. 125 // Stop the server.
126 await test.shutdown(); 126 await test.shutdown();
127 } 127 }
128 return sizes; 128 return sizes;
129 } 129 }
130 } 130 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/benchmark/perf/benchmark_scenario.dart ('k') | pkg/analysis_server/benchmark/perf/performance_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698