Increase QUnit async stop() timeout limit, improve documentation
authorTimo Tijhof <ttijhof@wikimedia.org>
Wed, 11 Apr 2012 17:26:06 +0000 (19:26 +0200)
committerTimo Tijhof <ttijhof@wikimedia.org>
Wed, 11 Apr 2012 17:26:06 +0000 (19:26 +0200)
- Raise from 5s to 10s. Should fix the false positives that sometimes
  happens in TestSwarm if a VM is being slow (especially IE6).

Change-Id: I4bc00b34040f5659c8456ce6978627c32497656d

tests/qunit/data/testrunner.js

index 30ae5bc..f4baf95 100644 (file)
@@ -10,24 +10,26 @@ var mwTestIgnore, mwTester, addons;
  * or 'data/test.php?foo=bar').
  * @return {String} Such as 'data/foo.js?131031765087663960'
  */
-QUnit.fixurl = function (value) {
+QUnit.fixurl = function ( value ) {
        return value + (/\?/.test( value ) ? '&' : '?')
                + String( new Date().getTime() )
-               + String( parseInt( Math.random()*100000, 10 ) );
+               + String( parseInt( Math.random() * 100000, 10 ) );
 };
 
 /**
  * Configuration
  */
-QUnit.config.testTimeout = 5000;
 
-/**
- * MediaWiki debug mode
- */
+// When a test() indicates asynchronicity with stop(),
+// allow 10 seconds to pass before killing the test(),
+// and assuming failure.
+QUnit.config.testTimeout = 10 * 1000;
+
+// Add a checkbox to QUnit header to toggle MediaWiki ResourceLoader debug mode.
 QUnit.config.urlConfig.push( 'debug' );
 
 /**
- *  Load TestSwarm agent
+ * Load TestSwarm agent
  */
 // Only if the current url indicates that there is a TestSwarm instance watching us
 // (TestSwarm appends swarmURL to the test suites url it loads in iframes).