jenkins-bot has submitted this change and it was merged.

Change subject: mediawiki.jqueryMsg.test: Call async() before each async test 
step
......................................................................


mediawiki.jqueryMsg.test: Call async() before each async test step

Previously, this code ran into the problem that the timeout for dozens of
API requests was hit and the test failed.
The timeout now starts within each individual step.

Bug: T125484
Change-Id: Ia7874ccafadf93986278a241d9d308be0bc99493
---
M tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
1 file changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Krinkle: Looks good to me, but someone else must approve
  Mattflaschen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
index 43b324e..07eddbf 100644
--- a/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
+++ b/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
@@ -119,9 +119,8 @@
        /**
         * @param {Function[]} tasks List of functions that perform tasks
         *  that may be asynchronous. Invoke the callback parameter when done.
-        * @param {Function} complete Called when all tasks are done, or when 
the sequence is aborted.
         */
-       function process( tasks, complete ) {
+       function process( tasks ) {
                /*jshint latedef:false */
                function abort() {
                        tasks.splice( 0, tasks.length );
@@ -140,7 +139,6 @@
                        } else {
                                // Remove tasks list to indicate the process is 
final.
                                tasks = null;
-                               complete();
                        }
                }
                next();
@@ -367,6 +365,7 @@
                mw.messages.set( mw.libs.phpParserData.messages );
                var tasks = $.map( mw.libs.phpParserData.tests, function ( test 
) {
                        return function ( next, abort ) {
+                               var done = assert.async();
                                getMwLanguage( test.lang )
                                        .then( function ( langClass ) {
                                                mw.config.set( 
'wgUserLanguage', test.lang );
@@ -379,12 +378,12 @@
                                        }, function () {
                                                assert.ok( false, 'Language "' 
+ test.lang + '" failed to load.' );
                                        } )
+                                       .then( done, done )
                                        .then( next, abort );
                        };
                } );
 
-               QUnit.stop();
-               process( tasks, QUnit.start );
+               process( tasks );
        } );
 
        QUnit.test( 'Links', 14, function ( assert ) {
@@ -888,6 +887,7 @@
                mw.messages.set( 'formatnum-msg-int', '{{formatnum:$1|R}}' );
                var queue = $.map( formatnumTests, function ( test ) {
                        return function ( next, abort ) {
+                               var done = assert.async();
                                getMwLanguage( test.lang )
                                        .then( function ( langClass ) {
                                                mw.config.set( 
'wgUserLanguage', test.lang );
@@ -901,11 +901,11 @@
                                        }, function () {
                                                assert.ok( false, 'Language "' 
+ test.lang + '" failed to load' );
                                        } )
+                                       .then( done, done )
                                        .then( next, abort );
                        };
                } );
-               QUnit.stop();
-               process( queue, QUnit.start );
+               process( queue );
        } );
 
        // HTML in wikitext

-- 
To view, visit https://gerrit.wikimedia.org/r/268427
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia7874ccafadf93986278a241d9d308be0bc99493
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: JanZerebecki <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to