Opened 12 years ago

Closed 12 years ago

#4001 closed defect (fixed)

doh runner.html gets multiple cursors when previous tests throws

Reported by: bill Owned by: alex
Priority: high Milestone: 0.9
Component: Dijit Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

ContentPane?.html runs without errors but when activated via runtests.html there are errors in setHref_then_cancel

I'm getting an alert on a dojo.disconnect(endHandler) that it was already disconnected.

Change History (4)

comment:1 Changed 12 years ago by bill

Description: modified (diff)

Looks like this

comment:2 Changed 12 years ago by mumme

Hum, well as far as I can see, the problem is that doh.runner isn't "thread safe". I don't have a better word, although I know JS don't have threads, "event loop safe" doesn't sound very good.

Take this: http://archive.dojotoolkit.org/dojo-2007-08-10/dojotoolkit/util/doh/runner.html?testModule=dijit.tests.module

The problem here is this: dijit.tests._Templated throws a error in one of the async tests then continues with dijit.tests.widgetsInTemplate AND dijit.tests.Container

Then _Templated throws a error and then we have 3 "cursors" trying to run tests simultaneously, that isn't working very well...

So fixing this means patching doh.runner.js

Index: trunk/doh/runner.js
===================================================================
--- trunk/doh/runner.js (revision 10071)
+++ trunk/doh/runner.js (working copy)
@@ -648,8 +648,7 @@
                                }

                                var timer = setTimeout(function(){
-                                       ret.cancel();
-                                       retEnd();
+                                       ret.errback(new Error("test timeout in "+fixture.name.toString()));
                                }, fixture["timeout"]||1000);

                                ret.addBoth(function(arg){
@@ -742,6 +741,11 @@
                if(!tg.inFlight){
                        if(tg["tearDown"]){ tg.tearDown(this); }
                        doh._groupFinished(groupName, (!tg.failures));
+               }else if(tg.inFlight > 0){
+                       setTimeout(this.hitch(this, function(){
+                               doh.runGroup(groupName, idx);
+                       }), 100);
+                       this._paused = true;
                }
        }
 }

But I'm to chicken to do this so close to the 0.9 release, and it does seem to surface some problems (need to extend timeouts) in dojo.tests.module

So I think that it's safe to punt this ticket to 1.0, or if somebody with more brains than me takes a look. (Understanding doh.runner.js sure isn't easy)

comment:3 Changed 12 years ago by mumme

Owner: changed from mumme to alex
Summary: ContentPane test failing on IEdoh runner.html gets multiple cursors when previous tests throws

Ok I talked to bill about this, and he wanted me to resassign this to you Alex.

I have some uggly testcases to develop/test against if you are interested

/ Fredrik

comment:4 Changed 12 years ago by alex

Resolution: fixed
Status: newclosed

(In [10090]) merging mumme's patch for better resilency against failed tests causing mutiple sets of tests to try to run at once. Fixes #4001

Note: See TracTickets for help on using tickets.