# Integration tests are super slow

**URL:** <https://discuss.emberjs.com/t/integration-tests-are-super-slow/7377>\
**Category:** Testing\
**Created:** [February 21, 2015, 9:58pm UTC](https://discuss.emberjs.com/t/integration-tests-are-super-slow/7377 "2015-02-21T21:58:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pilogiq](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/pilogiq/32/15908_2.png) [@Pilogiq](https://discuss.emberjs.com/u/Pilogiq)\
**Post date:** [February 21, 2015, 9:58pm UTC](https://discuss.emberjs.com/t/integration-tests-are-super-slow/7377/1 "2015-02-21T21:58:11Z")

</div>

Hi there !

I just started to automate my tests and I find that QUnit is taking too much time to run the tests (~10sec / test).

Is it normal ?

If not, do somebody have tips to increase the speed of QUnit ?

**EDIT** : It’s like the andThen clause is called after a timeout of 10 sec, even thought the route resolved and worked (the tests are green)

Here’s a sample of my tests

```
module('Supplements Controller', {
    beforeEach: function() {
        visit('/settings/supplements');
    },
    afterEach: function() {
        App.reset();
    }
});

test('first test', function() {
    andThen(function() {
        equal(find('tr').length, 6, '6 rows');
    });
});

test('Adding a supplement', function() {
    click('a.wm-title-btn');
    fillIn('input', 'new supplement');
    click('button.btn-success');

    andThen(function() {
        equal(find('tr').length, 7, '7 rows');
    });
});

```

---

<div class="post-metadata">

**Author:** ![mfeckie](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/mfeckie/32/15198_2.png) [@mfeckie](https://discuss.emberjs.com/u/mfeckie)\
**Post date:** [February 22, 2015, 10:20pm UTC](https://discuss.emberjs.com/t/integration-tests-are-super-slow/7377/2 "2015-02-22T22:20:39Z")

</div>

Can you try moving the `visit` call into the tests, rather than setup? Also, is that endpoint hitting any external services?

---

<div class="post-metadata">

**Author:** ![jasonmit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jasonmit/32/182_2.png) [@jasonmit](https://discuss.emberjs.com/u/jasonmit)\
**Post date:** [February 22, 2015, 10:40pm UTC](https://discuss.emberjs.com/t/integration-tests-are-super-slow/7377/3 "2015-02-22T22:40:56Z")

</div>

Not really sure about the 10second delay, but you should put `expect(1)` at the top of each test.

---

<div class="post-metadata">

**Author:** ![Pilogiq](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/pilogiq/32/15908_2.png) [@Pilogiq](https://discuss.emberjs.com/u/Pilogiq)\
**Post date:** [February 22, 2015, 11:30pm UTC](https://discuss.emberjs.com/t/integration-tests-are-super-slow/7377/4 "2015-02-22T23:30:45Z")

</div>

The app doesn’t access any external services (I’m using Fixtures for hte tests).

I tried your 2 suggestions and I still get the 10 seconds delay.

I see in my test-div that the route is visited in no time, but the test still wait of the `andThen` clause. From what I’m seeing, it’s like the `visit()` couldn’t say it actually resolved, instead, it wait the the generic 10 seconds timeout.

I’ll continue to dig arround. thanks !

---

<div class="post-metadata">

**Author:** ![sukima](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/sukima/32/5773_2.png) [@sukima](https://discuss.emberjs.com/u/sukima)\
**Post date:** [July 22, 2015, 2:12pm UTC](https://discuss.emberjs.com/t/integration-tests-are-super-slow/7377/5 "2015-07-22T14:12:41Z")

</div>

Any update on this. Our tests are also dog slow. Not only that but they are cumulatively slow (gets slower the more integrations test are ran). PS we use pretender for our network mocking.

---

<div class="post-metadata">

**Author:** ![yagni](https://avatars.discourse-cdn.com/v4/letter/y/ecd19e/32.png) [@yagni](https://discuss.emberjs.com/u/yagni)\
**Post date:** [August 14, 2015, 10:48pm UTC](https://discuss.emberjs.com/t/integration-tests-are-super-slow/7377/6 "2015-08-14T22:48:46Z")

</div>

Not sure if this helps you guys, but we just had the same problem. Our solution was twofold:

First, we had some tests that were from generators whose source classes had been deleted. So we had e.g. foo-component-test…when Ember ran the test, it tried to create a foo-component prior to the test (to set this.subject()), but failed. Each test that failed to create an object like that hung for about a minute before timing out and moving on. With 15 or so stale tests that quickly added up.

Second, we had a test that had a typo in its moduleForComponent call. It also hung for a minute, failing to create the component.

---

<div class="post-metadata">

**Author:** ![wjdhamilton](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@wjdhamilton](https://discuss.emberjs.com/u/wjdhamilton)\
**Post date:** [September 21, 2015, 12:57pm UTC](https://discuss.emberjs.com/t/integration-tests-are-super-slow/7377/7 "2015-09-21T12:57:37Z")

</div>

Perhaps a bit late to enter the conversation, but I am developing an ember app on cloud9 hence the development server is remote. Disabling the live-reload server massively increased the speed of my tests in the browser.
