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

Unified Diff: tests/standalone/src/SocketCloseTest.dart

Issue 9325062: Fix flakiness of SocketCloseTest by waiting for all close events. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/SocketCloseTest.dart
diff --git a/tests/standalone/src/SocketCloseTest.dart b/tests/standalone/src/SocketCloseTest.dart
index e8c4a7c3c8a746d6107a90dabaecc504f5ab705e..ea7daf3646136c88f8d8e217a3df20038ca6b9a7 100644
--- a/tests/standalone/src/SocketCloseTest.dart
+++ b/tests/standalone/src/SocketCloseTest.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
@@ -261,14 +261,12 @@ class SocketCloseServer extends Isolate {
}
waitForResult(Timer timer) {
- // Make sure all iterations have been run. For mode 0 and 1 the
- // client just closes the socket and after the last iteration
- // signals the server. The server might now be finished just
- // because iterations have reached the limit as this number is
- // incremented just after accept. In that case wait for the last
- // close event.
- if (_iterations == ITERATIONS &&
- (_mode > 1 || _closeEvents == ITERATIONS)) {
+ // Make sure all iterations have been run. In multiple of these
+ // scenarios it is possible to get the SERVERSHUTDOWN message
+ // before we have received the last close event on the
+ // server. We therefore always wait for the correct number of
+ // close events.
+ if (_iterations == ITERATIONS && _closeEvents == ITERATIONS) {
switch (_mode) {
case 0:
Expect.equals(0, _dataEvents);
« 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