Where to put timeout test?

Hi,

When fixing [this](https://phabricator.services.mozilla.com/D20947) bug, I =
need to add a test. If the patch is not applied, the test will spend almost=
 infinite time to render a SVG; while if the patch is applied, it can be re=
ndered instantly.

However, both the reviewer and me don't know how to put a timeout test. It =
won't crash in any case, so it's not a crash test. But the mochitest can on=
ly be used to check JavaScript assertion, if I use mochitest, the test util=
ity will hang waiting for JavaScript stuff, then eventually timeout because=
 there is nothing to assert.

Where to put a testcase like this?

Thanks!
0
violet
3/6/2019 6:04:30 AM
mozilla.dev.platform 6504 articles. 0 followers. Post Follow

2 Replies
12 Views

Similar Articles

[PageSpeed] 18

On Wed, Mar 6, 2019, at 5:05 PM, violet.bugreport@gmail.com wrote:
> However, both the reviewer and me don't know how to put a timeout test. 
> It won't crash in any case, so it's not a crash test. But the mochitest 
> can only be used to check JavaScript assertion, if I use mochitest, the 
> test utility will hang waiting for JavaScript stuff, then eventually 
> timeout because there is nothing to assert.
> 
> Where to put a testcase like this?

You can use a crashtest for this under layout/svg/crashtests/.  crashtests are like reftests that don't actually check against a reference, but will just fail if the test crashes, or causes some assertions, or times out.
0
Cameron
3/6/2019 6:12:25 AM
On Tuesday, March 5, 2019 at 10:12:48 PM UTC-8, Cameron McCormack wrote:

> You can use a crashtest for this under layout/svg/crashtests/.  crashtests are like reftests that don't actually check against a reference, but will just fail if the test crashes, or causes some assertions, or times out.

Thanks, it works!
0
violet
3/7/2019 1:45:57 AM
Reply: