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

Side by Side Diff: runtime/observatory/tests/service/object_graph_vm_test.dart

Issue 2896583002: Fix flaky test that makes assumptions about other things on the heap (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | runtime/observatory/tests/service/service_kernel.status » ('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 // VMOptions=--error_on_bad_type --error_on_bad_override 4 // VMOptions=--error_on_bad_type --error_on_bad_override
5 5
6 import 'package:observatory/heap_snapshot.dart'; 6 import 'package:observatory/heap_snapshot.dart';
7 import 'package:observatory/models.dart' as M; 7 import 'package:observatory/models.dart' as M;
8 import 'package:observatory/object_graph.dart'; 8 import 'package:observatory/object_graph.dart';
9 import 'package:observatory/service_io.dart'; 9 import 'package:observatory/service_io.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 14 matching lines...) Expand all
25 r = new Foo(); 25 r = new Foo();
26 var a = new Foo(); 26 var a = new Foo();
27 var b = new Foo(); 27 var b = new Foo();
28 r.left = a; 28 r.left = a;
29 r.right = b; 29 r.right = b;
30 a.left = b; 30 a.left = b;
31 31
32 lst = new List(2); 32 lst = new List(2);
33 lst[0] = lst; // Self-loop. 33 lst[0] = lst; // Self-loop.
34 // Larger than any other fixed-size list in a fresh heap. 34 // Larger than any other fixed-size list in a fresh heap.
35 lst[1] = new List(123456); 35 lst[1] = new List(1234569);
36 } 36 }
37 37
38 int fooId; 38 int fooId;
39 39
40 var tests = [ 40 var tests = [
41 (Isolate isolate) async { 41 (Isolate isolate) async {
42 Library lib = await isolate.rootLibrary.load(); 42 Library lib = await isolate.rootLibrary.load();
43 expect(lib.classes.length, equals(1)); 43 expect(lib.classes.length, equals(1));
44 Class fooClass = lib.classes.first; 44 Class fooClass = lib.classes.first;
45 fooId = fooClass.vmCid; 45 fooId = fooClass.vmCid;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 ObjectVertex first = lists[0]; 89 ObjectVertex first = lists[0];
90 ObjectVertex second = lists[1]; 90 ObjectVertex second = lists[1];
91 // Check that the short list retains more than the long list inside. 91 // Check that the short list retains more than the long list inside.
92 expect(first.successors.length, equals(2 + second.successors.length)); 92 expect(first.successors.length, equals(2 + second.successors.length));
93 // ... and specifically, that it retains exactly itself + the long one. 93 // ... and specifically, that it retains exactly itself + the long one.
94 expect(first.retainedSize, equals(first.shallowSize + second.shallowSize)); 94 expect(first.retainedSize, equals(first.shallowSize + second.shallowSize));
95 }, 95 },
96 ]; 96 ];
97 97
98 main(args) => runIsolateTests(args, tests, testeeBefore: script); 98 main(args) => runIsolateTests(args, tests, testeeBefore: script);
OLDNEW
« no previous file with comments | « no previous file | runtime/observatory/tests/service/service_kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698