Skip to content

Commit

Permalink
Increase delay to fix flakiness of integration test related to memory…
Browse files Browse the repository at this point in the history
… snapshotting. (#191)
  • Loading branch information
polina-c authored Dec 11, 2023
1 parent 8644f8b commit a9966d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/autosnapshotting/integration_test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -37,8 +39,7 @@ void main() {
await tester.tap(theButton);
await tester.pumpAndSettle();
}
await tester
.runAsync(() => Future<void>.delayed(const Duration(seconds: 5)));
await tester.runAsync(() => Future<void>.delayed(delayForSnapshot));
expect(pageState.snapshots.length, greaterThan(0));

// Take second threshold
Expand All @@ -49,8 +50,7 @@ void main() {
await tester.tap(theButton);
await tester.pumpAndSettle();
}
await tester
.runAsync(() => Future<void>.delayed(const Duration(seconds: 5)));
await tester.runAsync(() => Future<void>.delayed(delayForSnapshot));
expect(pageState.snapshots.length, snapshotsLength + 1);

// Check the directory limit is respected.
Expand Down

0 comments on commit a9966d2

Please sign in to comment.