Intermittent Travis Unit test failure: [sharedtest-test/unit/crop_resize_rotate_test.js] cropResizeRotate tests 250x250 Resize image to: 125x125: Error timeout

RESOLVED WORKSFORME

Status

Firefox OS
Gaia
RESOLVED WORKSFORME
4 years ago
3 years ago

People

(Reporter: julienw, Unassigned)

Tracking

({intermittent-failure})

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
1) [sharedtest-test/unit/crop_resize_rotate_test.js] cropResizeRotate tests 250x250 Resize image to: 125x125:

Error: timeout of 10000ms exceeded

at (anonymous) (http://sharedtest.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3680:9)
(Reporter)

Comment 1

4 years ago
Heu Russ, looks like you own this file, would you know what happens?
Is it just something that's meant to happen sometimes if the VM is too slow?
Flags: needinfo?(rnicoletti)
Hi Julien, typically the resize tests run in less than 50ms (locally). It seems reasonable to expect that when the VMs are very slow they will be affected, like many tests would be. But taking 10 seconds seems extreme. 

NI djf for his opinion.
Flags: needinfo?(rnicoletti) → needinfo?(dflanagan)
Julien,

Its my test case, written for 1.3T, but it is probably being run a lot more now that it has landed on master.

I've looked again at the code and don't see anything that is wrong with it.

Timeouts are only for individual tests, right? We don't have timeouts for entire suites, do we? It is a pretty massive suite of tests, and can take > 10s to run everything locally, IIRC. But none of the individual tests should take long. Note that this test file runs a suite of tests four times on four different size source images.  So this test that timed out on a 250x250 image passed twice before on other size images.

The test are creating, manipulating and comparing images, so they probably use more memory than typical tests, and maybe that stresses the Travis VM too much? We could reduce the number of tests.  We could increase the timeout.  

Maybe we're running into some kind of graphics bug on the host machine? We could modify the verifyImage() function in the test so that it uses { willReadFrequently: true } in the call to canvas.getContext().  I don't know if that does anything on desktop environment, but on the phone it takes 2d graphics off of the accelerated path and into pure software. In this case, it might actually speed the tests up since we are using the canvas just to read the image data.

Julien: have you seen this multiple times? If we try the change above, will we even be able to tell if it has any effect?

Russ: will you add willReadFrequently to line 440 in the test file?  If the tests still work with that addition, you have my r+ to land that change.  (Especially if it makes the tests run faster when you run them locally)
Flags: needinfo?(rnicoletti)
Flags: needinfo?(felash)
Flags: needinfo?(dflanagan)
Created PR (https://github.com/mozilla-b2g/gaia/pull/20169) for adding willReadFrequently in crop_resize_rotate_test.js verifyImage function. Will wait to hear from Julien regarding the frequency of the travis failures before landing.
Flags: needinfo?(rnicoletti)
(Reporter)

Comment 5

4 years ago
I really doubt "willReadFrequently" changes anything on Firefox/Linux.

The frequency is very low too.

What IMO happens is that there are lots of asynchronous operations happening in one test and this is completely legit and there is nothing much we can do. Maybe increasing mocha's timeout for this test file only to make it happen yet less often?

To answer the question, the 10s timeout is for one test only, not for the whole suite or even file.
Flags: needinfo?(felash)
(Reporter)

Comment 6

4 years ago
The main issue is that there are lots of tests in this file, and each tests is doing lots of asynchronous operations. So it's perfectly expected that in the constrained Travis environment, once in a while, a timeout happens. Let's increase the timeout for the file.

Comment 7

3 years ago
Inactive; closing (see bug 1180138).
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.