Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c committed Jul 20, 2023
1 parent a1a10d5 commit bd1a592
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 37 deletions.
2 changes: 0 additions & 2 deletions pkgs/leak_tracker/lib/src/leak_tracking/_object_tracker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,6 @@ class ObjectTracker implements LeakProvider {
Future<void> _addRetainingPath(List<int> objectsToGetPath) async {
final connection = await connect();

print('connected!!!');

final pathSetters = objectsToGetPath.map((code) async {
final record = _objects.notGCed[code]!;
final path =
Expand Down
43 changes: 8 additions & 35 deletions pkgs/leak_tracker/test/release/leak_tracking/end_to_end_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
import 'package:leak_tracker/leak_tracker.dart';
import 'package:leak_tracker/src/shared/_primitives.dart';
import 'package:leak_tracker_testing/leak_tracker_testing.dart';
import 'package:logging/logging.dart';

import 'package:test/test.dart';

import '../../test_infra/data/dart_classes.dart';

/// Tests for non-mocked public API of leak tracker.
void main() {
Logger.root.onRecord.listen((LogRecord record) => print(record.message));

tearDown(() {
disableLeakTracking();
});
Expand Down Expand Up @@ -57,19 +54,6 @@ void main() {
expect(theLeak.trackedClass, contains('$LeakTrackedClass'));
});

test('temp', () async {
Future<void> f1() async {
await Future.delayed(const Duration(milliseconds: 100));
throw StateError('f1');
}

try {
await Future.wait<void>([f1(), f1()]);
} catch (e) {
print(e);
}
});

test('Retaining path cannot be collected in release mode, $gcCountBuffer.',
() async {
late LeakTrackedClass notGCedObject;
Expand All @@ -88,25 +72,14 @@ void main() {
);
}

try {
await test();
} on StateError catch (error) {
print(error);
// expect(error, isA<StateError>());
// expect(
// error.toString(),
// contains('Leak troubleshooting is not available in release mode.'),
// );
}

// await expectLater(
// test,
// throwsA(
// predicate(
// (e) => e is StateError && e.message.contains('--debug'),
// ),
// ),
// );
await expectLater(
test,
throwsA(
predicate(
(e) => e is StateError && e.message.contains('--debug'),
),
),
);
});

test('$isLeakFree succeeds, $gcCountBuffer.', () async {
Expand Down

0 comments on commit bd1a592

Please sign in to comment.