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

Side by Side Diff: test/datastore/e2e/datastore_test_impl.dart

Issue 695533003: Increase delay when after eventually consistent operations in datastore/storage (Closed) Base URL: git@github.com:dart-lang/gcloud.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « test/common_e2e.dart ('k') | test/db/e2e/db_test_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library datastore_test; 5 library datastore_test;
6 6
7 /// NOTE: In order to run these tests, the following datastore indices must 7 /// NOTE: In order to run these tests, the following datastore indices must
8 /// exist: 8 /// exist:
9 /// $ cat index.yaml 9 /// $ cat index.yaml
10 /// indexes: 10 /// indexes:
(...skipping 21 matching lines...) Expand all
32 import 'package:gcloud/datastore.dart'; 32 import 'package:gcloud/datastore.dart';
33 import 'package:gcloud/src/datastore_impl.dart' as datastore_impl; 33 import 'package:gcloud/src/datastore_impl.dart' as datastore_impl;
34 import 'package:gcloud/common.dart'; 34 import 'package:gcloud/common.dart';
35 import 'package:unittest/unittest.dart'; 35 import 'package:unittest/unittest.dart';
36 36
37 import '../error_matchers.dart'; 37 import '../error_matchers.dart';
38 import 'utils.dart'; 38 import 'utils.dart';
39 39
40 import '../../common_e2e.dart'; 40 import '../../common_e2e.dart';
41 41
42 // Note:
43 // Non-ancestor queries (i.e. queries not lookups) result in index scans.
44 // The index tables are updated in a "eventually consistent" way.
45 //
46 // So this can make tests flaky, the index updates take longer than the
47 // following constant.
48 const INDEX_UPDATE_DELAY = const Duration(seconds: 10);
49
50 Future sleep(Duration duration) { 42 Future sleep(Duration duration) {
51 var completer = new Completer(); 43 var completer = new Completer();
52 new Timer(duration, completer.complete); 44 new Timer(duration, completer.complete);
53 return completer.future; 45 return completer.future;
54 } 46 }
55 47
56 Future<List<Entity>> consumePages(FirstPageProvider provider) { 48 Future<List<Entity>> consumePages(FirstPageProvider provider) {
57 return new StreamFromPages(provider).stream.toList(); 49 return new StreamFromPages(provider).stream.toList();
58 } 50 }
59 51
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 main() { 1029 main() {
1038 var scopes = datastore_impl.DatastoreImpl.SCOPES; 1030 var scopes = datastore_impl.DatastoreImpl.SCOPES;
1039 1031
1040 withAuthClient(scopes, (String project, httpClient) { 1032 withAuthClient(scopes, (String project, httpClient) {
1041 var datastore = new datastore_impl.DatastoreImpl(httpClient, 's~$project'); 1033 var datastore = new datastore_impl.DatastoreImpl(httpClient, 's~$project');
1042 return cleanupDB(datastore).then((_) { 1034 return cleanupDB(datastore).then((_) {
1043 return runE2EUnittest(() => runTests(datastore)); 1035 return runE2EUnittest(() => runTests(datastore));
1044 }); 1036 });
1045 }); 1037 });
1046 } 1038 }
OLDNEW
« no previous file with comments | « test/common_e2e.dart ('k') | test/db/e2e/db_test_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698