Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily Disabling Flaky Integration Tests in Plugin Example Apps #8109

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ void main() {
await controller.dispose();
}
}
});
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
}, skip: true);

// This tests that the capture is no bigger than the preset, since we have
// automatic code to fall back to smaller sizes when we need to. Returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ void main() {
await controller.dispose();
}
}
});
},
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
skip: true);

// This tests that the capture is no bigger than the preset, since we have
// automatic code to fall back to smaller sizes when we need to. Returns
Expand Down Expand Up @@ -197,7 +199,9 @@ void main() {
await videoController.dispose();

expect(duration, lessThan(recordingTime - timePaused));
});
},
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
skip: true);

testWidgets('Set description while recording', (WidgetTester tester) async {
final List<CameraDescription> cameras =
Expand Down Expand Up @@ -234,7 +238,9 @@ void main() {
// cameras switched
expect(controller.description, cameras[1]);
}
});
},
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
skip: true);

testWidgets('Set description', (WidgetTester tester) async {
final List<CameraDescription> cameras =
Expand All @@ -249,79 +255,79 @@ void main() {
await controller.setDescription(cameras[1]);

expect(controller.description, cameras[1]);
});
},
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
skip: true);

testWidgets(
'image streaming',
(WidgetTester tester) async {
final List<CameraDescription> cameras =
await CameraPlatform.instance.availableCameras();
if (cameras.isEmpty) {
testWidgets('image streaming', (WidgetTester tester) async {
final List<CameraDescription> cameras =
await CameraPlatform.instance.availableCameras();
if (cameras.isEmpty) {
return;
}

final CameraController controller = CameraController(cameras[0]);

await controller.initialize();
bool isDetecting = false;

await controller.startImageStream((CameraImageData image) {
if (isDetecting) {
return;
}

final CameraController controller = CameraController(cameras[0]);
isDetecting = true;

await controller.initialize();
bool isDetecting = false;
expectLater(image, isNotNull).whenComplete(() => isDetecting = false);
});

await controller.startImageStream((CameraImageData image) {
if (isDetecting) {
return;
}
expect(controller.value.isStreamingImages, true);

isDetecting = true;
sleep(const Duration(milliseconds: 500));

expectLater(image, isNotNull).whenComplete(() => isDetecting = false);
});
await controller.stopImageStream();
await controller.dispose();
},
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
skip: true);

expect(controller.value.isStreamingImages, true);
testWidgets('recording with image stream', (WidgetTester tester) async {
final List<CameraDescription> cameras =
await CameraPlatform.instance.availableCameras();
if (cameras.isEmpty) {
return;
}

sleep(const Duration(milliseconds: 500));
final CameraController controller = CameraController(cameras[0]);

await controller.stopImageStream();
await controller.dispose();
},
);
await controller.initialize();
bool isDetecting = false;

testWidgets(
'recording with image stream',
(WidgetTester tester) async {
final List<CameraDescription> cameras =
await CameraPlatform.instance.availableCameras();
if (cameras.isEmpty) {
await controller.startVideoRecording(
streamCallback: (CameraImageData image) {
if (isDetecting) {
return;
}

final CameraController controller = CameraController(cameras[0]);

await controller.initialize();
bool isDetecting = false;

await controller.startVideoRecording(
streamCallback: (CameraImageData image) {
if (isDetecting) {
return;
}
isDetecting = true;

isDetecting = true;
expectLater(image, isNotNull);
});

expectLater(image, isNotNull);
});
expect(controller.value.isStreamingImages, true);

expect(controller.value.isStreamingImages, true);
// Stopping recording before anything is recorded will throw, per
// https://developer.android.com/reference/android/media/MediaRecorder.html#stop()
// so delay long enough to ensure that some data is recorded.
await Future<void>.delayed(const Duration(seconds: 2));

// Stopping recording before anything is recorded will throw, per
// https://developer.android.com/reference/android/media/MediaRecorder.html#stop()
// so delay long enough to ensure that some data is recorded.
await Future<void>.delayed(const Duration(seconds: 2));
await controller.stopVideoRecording();
await controller.dispose();

await controller.stopVideoRecording();
await controller.dispose();

expect(controller.value.isStreamingImages, false);
},
);
expect(controller.value.isStreamingImages, false);
},
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
skip: true);

group('Camera settings', () {
Future<CameraDescription> getCamera() async {
Expand Down Expand Up @@ -457,5 +463,7 @@ void main() {
expect(lengths[n], greaterThan(0));
}
});
});
},
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
skip: true);
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ void main() {
await controller.dispose();
}
}
});
},
// TODO(camillesimon): Re-enable test when issue is fixed https://github.com/flutter/flutter/issues/154682.
skip: true);

testWidgets('Preview takes expected resolution from preset',
(WidgetTester tester) async {
Expand Down