test: v4l2_videodevice: Increase timeout for vimc capture tests
On slower machines, a 10s timeout to capture frames with vimc can be too short and cause test failures. Make the timeout proportional to the number of frames expected to be captured, using a conservative low estimate of the frame rate at 2fps. This does not increase the test time if the vimc driver is fast enough to produce frames. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
This commit is contained in:
parent
dedf9cf264
commit
73f18f32c9
1 changed files with 7 additions and 4 deletions
|
@ -61,10 +61,12 @@ protected:
|
|||
if (ret)
|
||||
return TestFail;
|
||||
|
||||
timeout.start(10000ms);
|
||||
const unsigned int nFrames = 30;
|
||||
|
||||
timeout.start(500ms * nFrames);
|
||||
while (timeout.isRunning()) {
|
||||
dispatcher->processEvents();
|
||||
if (frames > 30)
|
||||
if (frames > nFrames)
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -73,8 +75,9 @@ protected:
|
|||
return TestFail;
|
||||
}
|
||||
|
||||
if (frames < 30) {
|
||||
std::cout << "Failed to capture 30 frames within timeout." << std::endl;
|
||||
if (frames < nFrames) {
|
||||
std::cout << "Failed to capture " << nFrames
|
||||
<< " frames within timeout." << std::endl;
|
||||
return TestFail;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue