Skip to content

Commit b61735b

Browse files
[video_player] Skip flaky tests in certain circumstances on Android (flutter#5872)
Temporary workaround for flutter#141145 This doesn't fully skip the test because this problem doesn't happen in CI device tests or locally, so rather than totally lose coverage this detects the very specific markers of this flake and skips only when that happens. This should allow the tree to stop being so red with the minimal coverage loss while we investigate this further. Part of flutter#141145
1 parent 5fd5fb9 commit b61735b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/video_player/video_player/example/integration_test/video_player_test.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ void main() {
133133
await controller.seekTo(tenMillisBeforeEnd);
134134
await controller.play();
135135
await tester.pumpAndSettle(_playDuration);
136+
// Android emulators in our CI have frequent flake where the video
137+
// reports as still playing (usually without having advanced at all
138+
// past the seek position, but sometimes having advanced some); if that
139+
// happens, the thing being tested hasn't even had a chance to happen
140+
// due to CI issues, so just report it as skipped.
141+
// TODO(stuartmorgan): Remove once
142+
// https://github.com/flutter/flutter/issues/141145 is fixed.
143+
if ((!kIsWeb && Platform.isAndroid) && controller.value.isPlaying) {
144+
markTestSkipped(
145+
'Skipping due to https://github.com/flutter/flutter/issues/141145');
146+
return;
147+
}
136148
expect(controller.value.isPlaying, false);
137149
expect(controller.value.position, controller.value.duration);
138150

@@ -157,6 +169,18 @@ void main() {
157169
controller.value.duration - const Duration(milliseconds: 10));
158170
await controller.play();
159171
await tester.pumpAndSettle(_playDuration);
172+
// Android emulators in our CI have frequent flake where the video
173+
// reports as still playing (usually without having advanced at all
174+
// past the seek position, but sometimes having advanced some); if that
175+
// happens, the thing being tested hasn't even had a chance to happen
176+
// due to CI issues, so just report it as skipped.
177+
// TODO(stuartmorgan): Remove once
178+
// https://github.com/flutter/flutter/issues/141145 is fixed.
179+
if ((!kIsWeb && Platform.isAndroid) && controller.value.isPlaying) {
180+
markTestSkipped(
181+
'Skipping due to https://github.com/flutter/flutter/issues/141145');
182+
return;
183+
}
160184
expect(controller.value.isPlaying, false);
161185
expect(controller.value.position, controller.value.duration);
162186

0 commit comments

Comments
 (0)