Get help with testing, discuss unit testing strategies etc.


Post by zombeerose »

I am gradually writing tests for my extra-large app, which is basically a portal mash-up with many mini-apps. So far, I have about 190 test files with about 1200 assertions. Most of these tests simply render the components or validate the models. I still have to go back and add more "meat" into them.

Unfortunately, I can't run all of the tests at once, even after a fresh page load. The memory usage in Chrome starts at about 70MB and grows to nearly 1GB before the page dies. There are only a handful of failures, the majority of which are unexpected Ext globals. No tests are throwing exceptions.

So I'm looking for advice/guidance/feedback regarding how to deal with this. Was Siesta designed to handle such a large # of tests? Are their any options I'm missing to help Siesta free up the memory? What am I doing wrong or what I can do better?

I'm not dismissing that the components in my "app" may be leaking memory. However, if I only run the tests against the models, then memory still grows to almost 500MB.

I am running Chrome 17. Siesta is running Ext 4.0.7 and my app is running Ext 4.1 beta 2.

My harness config:
Harness.configure({
    autoCheckGlobals: true,
    expectedGlobals: [...],
    forceDOMVisible: Ext.isIE,
    needDone: true,
    preload: [...],
    speedRun: true,
    testClass: Portal.TestClass,
    title: 'Portal Test Suite',
    transparentEx: true, //When true the harness will NOT try to catch any exception.
    viewDOM: true
});

Post by nickolay »

zombeerose wrote:I am gradually writing tests for my extra-large app, which is basically a portal mash-up with many mini-apps. So far, I have about 190 test files with about 1200 assertions.
Wow, great test suite!

We are currently facing the same problem when testing our components. Our test suite now contains > 70 files - only for scheduler and memory consumption grows with each new file. For now Siesta creates new iframe for each test and by default it does not free it.
As an immediate solution, try to use "keepResults : false" option on harness - Siesta will free the iframe immediately after test completes.

But thats not enough, as it seems even Chrome can't free all memory allocated for iframes. The plan for this issue is to re-use a single iframe for all tests - relatively serious change and something for 1.0.8 - 1.0.9, may be for 1.1.0..
1.0.7 is scheduled next week.

Post by zombeerose »

Thanks for the info. I'm relieved to know that I'm not going insane :) However, I can empathize with the pain associated with a major refactor.

BTW, it's a great product, easy to learn, and easy to use. That's why I've gone crazy writing tests. Many thanks to you guys and all your hard work.

Oh ya - and I'm anxious for 1.0.7 :)

Post by nickolay »

So pleasant to hear, thanks!

Post Reply