Closed Bug 956648 Opened 10 years ago Closed 10 years ago

Use 10s default unit test timeout

Categories

(Firefox OS Graveyard :: Gaia::TestAgent, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kgrandon, Assigned: kgrandon)

Details

Attachments

(3 files)

Travis generally runs much slower than testing on a local machine. Because IndexedDB access may take a long time, and often blows past the default 2s timeout, we should use a default timeout of 20s.
Once this is done, I think we can remove all of the this.timeout() calls scattered throughout the tests.
In an ideal world, I'd rather have the 20 second timeouts in IndexedDB tests only, but in our world where developers are still doing asynchronous tests, I agree with this bug to lower the intermittent frequency.
Julien, James - Before I dig into test-agent code, would you happen to know off the top of your head the best way to implement this or where to look? If you want to write a quick patch for this too, that would be nice :)  Thanks!
Flags: needinfo?(jlal)
Flags: needinfo?(felash)
Attached file Github pull request
This might do what I want to do - but I'm not entirely sure the best way to test it until we run on travis.
I think this is the correct way.

Usually, to code for test-agent, I modify directly the file test-agent.js in gaia's test_apps, and then, once it works as I want, I report the changes in js-test-agent. I'm sure there is a better way to work with npm ;-)
Flags: needinfo?(felash)
Comment on attachment 8356444 [details] [review]
Github pull request

adding review, I'll test today
Attachment #8356444 - Flags: review?(felash)
(In reply to Julien Wajsberg [:julienw] from comment #5)
> I think this is the correct way.
> 
> Usually, to code for test-agent, I modify directly the file test-agent.js in
> gaia's test_apps, and then, once it works as I want, I report the changes in
> js-test-agent. I'm sure there is a better way to work with npm ;-)

Yeah, that sounds like a good way. I guess for testing on travis we should ask for npm permissions, then we could publish and test with an alpha version.
I wonder if there is a better way to work locally with npm, with the local .npm cache. Like publishing to ~/.npm an alpha version. Coming from Java I know it's possible with maven.
(In reply to Julien Wajsberg [:julienw] from comment #8)
> I wonder if there is a better way to work locally with npm, with the local
> .npm cache. Like publishing to ~/.npm an alpha version. Coming from Java I
> know it's possible with maven.

For working locally with npm you can use the npm link command. Maybe you are looking for that?

https://npmjs.org/doc/cli/npm-link.html
Comment on attachment 8356444 [details] [review]
Github pull request

r=me but with 10 seconds instead of 20 seconds.
Attachment #8356444 - Flags: review?(felash) → review+
Flags: needinfo?(jlal)
js-test-agent master commit: 810342e8b2043cfeb8a66553161ec6a8db73fc22
gaia master commit: a9b0870224c3edcfbba2c276c05b47812610b61d

Kevin, you need to run "make update-common" and do a PR from this too. For the test-agent, we don't "npm install" automatically (yet).
Hi Julien - Thanks for the info. I have ~3 green test runs after updating the test agent and removing timeouts. I think we should be good to go here, can you review this one?
Attachment #8363093 - Flags: review?(felash)
Assignee: nobody → kgrandon
Summary: Use 20s default unit test timeout → Use 10s default unit test timeout
Comment on attachment 8363093 [details] [review]
Github pull request - Remove test timeouts, update js agent

r=me

you missed some timeout calls in the "communications/" apps, and I think we should keep the bigger timeouts in some of the files (although I can accept that we remove them now and we add them back if we need to, so you can land with all timeout calls removed if you want).
Attachment #8363093 - Flags: review?(felash) → review+
I added the calendar ones here, and I think that 10s is acceptable. I would like to land with them all removed if possible, and if there are problems, we can re-investigate. Thanks for the review!
Good for me, let's do this.
Landed after 2 green runs: https://github.com/mozilla-b2g/gaia/commit/2162b4a2fb2cb08d93433c574462062286cd3f05

I'm going to keep monitoring travis to ensure we don't have intermittent because of this. This should solve the last few intermittent failures that we have been seeing recently.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: