From 2bc4c7a8884b75b0a80a2d9988f5617f3189a789 Mon Sep 17 00:00:00 2001 From: Polina Cherkasova Date: Wed, 30 Aug 2023 16:25:18 -0700 Subject: [PATCH] Mark routing test as leaking. (#133697) --- packages/flutter/test/material/app_test.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/flutter/test/material/app_test.dart b/packages/flutter/test/material/app_test.dart index 88aafa258aba..14d7f270e0e8 100644 --- a/packages/flutter/test/material/app_test.dart +++ b/packages/flutter/test/material/app_test.dart @@ -57,7 +57,7 @@ void main() { expect(focusNode.hasFocus, isTrue); }); - testWidgets('Can place app inside FocusScope', (WidgetTester tester) async { + testWidgetsWithLeakTracking('Can place app inside FocusScope', (WidgetTester tester) async { final FocusScopeNode focusScopeNode = FocusScopeNode(); await tester.pumpWidget(FocusScope( @@ -69,6 +69,7 @@ void main() { )); expect(find.text('Home'), findsOneWidget); + focusScopeNode.dispose(); }); testWidgetsWithLeakTracking('Can show grid without losing sync', (WidgetTester tester) async { @@ -310,7 +311,7 @@ void main() { expect(find.text('route "/b"', skipOffstage: false), findsNothing); }); - testWidgets('Initial route with missing step', (WidgetTester tester) async { + testWidgetsWithLeakTracking('Initial route with missing step', (WidgetTester tester) async { final Map routes = { '/': (BuildContext context) => const Text('route "/"'), '/a': (BuildContext context) => const Text('route "/a"'), @@ -333,7 +334,12 @@ void main() { expect(find.text('route "/a/b"'), findsNothing); expect(find.text('route "/b"'), findsNothing); } - }); + }, + // TODO(polina-c): remove after fixing + // https://github.com/flutter/flutter/issues/133695 + leakTrackingTestConfig: const LeakTrackingTestConfig( + notDisposedAllowList: {'ValueNotifier': 3}, + )); testWidgetsWithLeakTracking('Make sure initialRoute is only used the first time', (WidgetTester tester) async { final Map routes = {