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

Unified Diff: pkg/analysis_server/test/integration/edit/get_fixes_test.dart

Issue 2934813002: Fix a race condition in an analysis server test. (Closed)
Patch Set: Created 3 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/integration/edit/get_fixes_test.dart
diff --git a/pkg/analysis_server/test/integration/edit/get_fixes_test.dart b/pkg/analysis_server/test/integration/edit/get_fixes_test.dart
index eccbe2916bf82c4f6876101631ecde4b3d2725a2..3583c76176bfb5cf89ee9ebf4cac466a3a92dff9 100644
--- a/pkg/analysis_server/test/integration/edit/get_fixes_test.dart
+++ b/pkg/analysis_server/test/integration/edit/get_fixes_test.dart
@@ -46,12 +46,12 @@ Future f;
expect(change.edits.first.edits, hasLength(1));
SourceEdit edit = change.edits.first.edits.first;
text = text.replaceRange(edit.offset, edit.end, edit.replacement);
- writeFile(pathname, text);
- await analysisFinished;
- // The errors (at least sometimes) don't get sent until after analysis has
- // completed. Wait long enough to see whether new errors are reported.
- await new Future.delayed(new Duration(milliseconds: 1000));
+ // save the fixed text as an overlay
+ Future analysisFinishedFuture = analysisFinished;
+ sendAnalysisUpdateContent({pathname: new AddContentOverlay(text)});
+ await analysisFinishedFuture;
+
expect(currentAnalysisErrors[pathname], isEmpty);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698