Page MenuHomePhabricator

RelatedArticles causes tests of Echo to fail
Closed, ResolvedPublic

Description

The RelatedArticles tests depends on some other repositories. @bmansurov made a change to CI to have the repository tests with a bunch of other repositories (mediawiki-extensions-*) jobs.

We gave it a try with https://gerrit.wikimedia.org/r/#/c/246818/ but that caused tests of at least Echo and Flow to fail I have reverted CI immediately with https://gerrit.wikimedia.org/r/#/c/246829/

An example test report is https://integration.wikimedia.org/ci/job/mediawiki-extensions-hhvm/35991/testReport/ :

EchoTitleLocalCacheTest::testGet
mysql_real_escape_string() expects parameter 1 to be string, array given

Path: /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm/src/
includes/db/DatabaseMysqli.php:309
includes/db/DatabaseMysqlBase.php:560
includes/db/Database.php:2531
includes/db/Database.php:2077
includes/db/Database.php:1914
includes/db/DBConnRef.php:39
includes/db/DBConnRef.php:268
includes/deferred/LinksUpdate.php:343
includes/deferred/LinksUpdate.php:208
includes/deferred/LinksUpdate.php:145
includes/deferred/DataUpdate.php:99
includes/deferred/DeferredUpdates.php:119
includes/deferred/DeferredUpdates.php:79
includes/page/WikiPage.php:2185
includes/page/WikiPage.php:1947
tests/phpunit/MediaWikiTestCase.php:447
extensions/Echo/tests/phpunit/cache/TitleLocalCacheTest.php:28
tests/phpunit/MediaWikiTestCase.php:137

I reproduced it locally with Sqlite and just Echo + RelatedArticles.

For Sqlite that ends up falling when calling addQuotes() on an array. I also spotted some warnings such as:

Warning: bin2hex() expects parameter 1 to be string, array given in includes/db/DatabaseSqlite.php on line 817

What I found is that it seems to be caused by the RelatedArticles hook onParserClearState which does:

$parser->getOutput()->setProperty( 'RelatedArticles', array() );

If I comment it out, it is all fine.

To test the behavior, one can propose a dummy patch in Gerrit for RelatedArticles then comment check experimental. That will run the mediawiki-extensions-hhvm job and inject RelatedArticles into it.

Details

Related Gerrit Patches:
mediawiki/extensions/RelatedArticles : wmf/1.27.0-wmf.3Clear extension data in ParserClearState handler
mediawiki/extensions/RelatedArticles : masterClear extension data in ParserClearState handler

Event Timeline

hashar created this task.Oct 16 2015, 2:03 PM
hashar raised the priority of this task from to Needs Triage.
hashar updated the task description. (Show Details)
hashar added a project: RelatedArticles.
hashar added subscribers: hashar, bmansurov, phuedx.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 16 2015, 2:03 PM

Change 246836 had a related patch set uploaded (by Phuedx):
Clear extension data in ParserClearState handler

https://gerrit.wikimedia.org/r/246836

Change 247991 had a related patch set uploaded (by Jdlrobson):
Clear extension data in ParserClearState handler

https://gerrit.wikimedia.org/r/247991

We should probably backport this as it's going to fill the parser cache for Wikivoyage where it's deployed.

Jdlrobson assigned this task to phuedx.Oct 22 2015, 7:55 AM
Jdlrobson set Security to None.

Change 246836 merged by jenkins-bot:
Clear extension data in ParserClearState handler

https://gerrit.wikimedia.org/r/246836

@Jdlrobson: 247991 will need I484ebfe to be backported too.

Jdlrobson closed this task as Resolved.Oct 26 2015, 7:57 PM

I'm not going to have time to SWAT this, this afternoon. @jhobs would you be able to? I can give test instructions.

Things to be swatted in order are:
https://gerrit.wikimedia.org/r/#/c/248947/
https://gerrit.wikimedia.org/r/#/c/247991/

If we don't make it today, I'm keen to just wait till Wednesday, given this has already been present for a week and a few days probably won't save us much.

Patch is now live.

Change 247991 abandoned by Jdlrobson:
Clear extension data in ParserClearState handler

Reason:
wmf4 is now the thing

https://gerrit.wikimedia.org/r/247991