From a9966d224f317a0f656037eb48eb72b6593e6a62 Mon Sep 17 00:00:00 2001 From: Polina Cherkasova Date: Mon, 11 Dec 2023 10:30:14 -0800 Subject: [PATCH] Increase delay to fix flakiness of integration test related to memory snapshotting. (#191) --- examples/autosnapshotting/integration_test/app_test.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/autosnapshotting/integration_test/app_test.dart b/examples/autosnapshotting/integration_test/app_test.dart index b6e428d1..2665debf 100644 --- a/examples/autosnapshotting/integration_test/app_test.dart +++ b/examples/autosnapshotting/integration_test/app_test.dart @@ -23,6 +23,8 @@ void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Snapshots are not taken after reaching limit', (tester) async { + // Delay needed to detect memory usage is increased and take snapshot. + final delayForSnapshot = const Duration(seconds: 10); app.main([], snapshotDirectory: '$_testDirRoot/$pid'); await tester.pumpAndSettle(); @@ -37,8 +39,7 @@ void main() { await tester.tap(theButton); await tester.pumpAndSettle(); } - await tester - .runAsync(() => Future.delayed(const Duration(seconds: 5))); + await tester.runAsync(() => Future.delayed(delayForSnapshot)); expect(pageState.snapshots.length, greaterThan(0)); // Take second threshold @@ -49,8 +50,7 @@ void main() { await tester.tap(theButton); await tester.pumpAndSettle(); } - await tester - .runAsync(() => Future.delayed(const Duration(seconds: 5))); + await tester.runAsync(() => Future.delayed(delayForSnapshot)); expect(pageState.snapshots.length, snapshotsLength + 1); // Check the directory limit is respected.