Page MenuHomePhabricator

Tests fails on ApiEditPageTest::testEditWhileReadOnly fails with PHP Fatal error on MacOS, php 7.4.1 if Wikibase/repo enabled
Open, LowPublic

Description

Motivation

At the moment it's impossible to run all tests due to PHP Fatal error on ApiEditPageTest::testEditWhileReadOnly.

Say command line:
php ./tests/phpunit/phpunit.php --colors=always --configuration ./tests/phpunit/suite.xml --filter ApiEditPageTest::testEditWhileReadOnly

fails with error:

PHP Fatal error: Uncaught JobQueueReadOnlyError: Job queue is read-only: Read-only for testing in /Users/peter/work/Wiki/gerrit/mediawiki/includes/jobqueue/JobQueue.php:731

PHP  26. MediaWiki\Storage\DerivedPageDataUpdater->doUpdates() /Users/peter/work/Wiki/gerrit/mediawiki/includes/Storage/PageUpdater.php:1264
PHP  27. WikiPage::onArticleCreate($title = *uninitialized*) /Users/peter/work/Wiki/gerrit/mediawiki/includes/Storage/DerivedPageDataUpdater.php:1575
PHP  28. Title->touchLinks() /Users/peter/work/Wiki/gerrit/mediawiki/includes/page/WikiPage.php:3479
PHP  29. JobQueueGroup->lazyPush($jobs = *uninitialized*) /Users/peter/work/Wiki/gerrit/mediawiki/includes/Title.php:4190
PHP  30. JobQueueGroup->push($jobs = *uninitialized*) /Users/peter/work/Wiki/gerrit/mediawiki/includes/jobqueue/JobQueueGroup.php:210
PHP  31. JobQueueMemory->push($jobs = *uninitialized*, $flags = *uninitialized*) /Users/peter/work/Wiki/gerrit/mediawiki/includes/jobqueue/JobQueueGroup.php:171
PHP  32. JobQueueMemory->batchPush($jobs = *uninitialized*, $flags = *uninitialized*) /Users/peter/work/Wiki/gerrit/mediawiki/includes/jobqueue/JobQueue.php:337
PHP  33. JobQueueMemory->assertNotReadOnly() /Users/peter/work/Wiki/gerrit/mediawiki/includes/jobqueue/JobQueue.php:351

Expected Results

The following cli command should pass successfully:

php ./tests/phpunit/phpunit.php --colors=always --configuration ./tests/phpunit/suite.xml --filter ApiEditPageTest::testEditWhileReadOnly

Note:

Wikibase/repo should be installed and enabled

Event Timeline

Peter.ovchyn renamed this task from Tests fails on ApiEditPageTest::testEditWhileReadOnly fails with PHP Fatal error on MacOS, php 7.4.1 to Tests fails on ApiEditPageTest::testEditWhileReadOnly fails with PHP Fatal error on MacOS, php 7.4.1 if Wikibase/client installed.Apr 29 2020, 6:55 PM
Peter.ovchyn updated the task description. (Show Details)
Peter.ovchyn updated the task description. (Show Details)

@Peter.ovchyn: Assuming this task is about the MediaWiki-Core-Tests code project, hence adding that project tag so other people who don't know or don't care about team tags can also find this task when searching via projects.

That error looks strange. We should never get into DerivedPageDataUpdater->doUpdates() if the DB is flagged as read-only. EditPage should fail long before that. The relevant check is in EditPage::internalAttemptSave().

Wikibase/client should be installed and enabled

So with Wikibase not installed, the error does not occurr?

So with Wikibase not installed, the error does not occurr?

I've just performed some research. Looks like issue is in wikibase/repo, not wikibase/client.

$wgEnableWikibaseRepo = false;
$wgEnableWikibaseClient = true;
// require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
// require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";

Now everything is ok.

$wgEnableWikibaseRepo = true;
//$wgEnableWikibaseClient = true;
require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
// require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
// require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";

Tests fail.

Peter.ovchyn renamed this task from Tests fails on ApiEditPageTest::testEditWhileReadOnly fails with PHP Fatal error on MacOS, php 7.4.1 if Wikibase/client installed to Tests fails on ApiEditPageTest::testEditWhileReadOnly fails with PHP Fatal error on MacOS, php 7.4.1 if Wikibase/repo enabled.May 7 2020, 11:29 AM
Peter.ovchyn updated the task description. (Show Details)
daniel added a subscriber: Addshore.

Untagging CPT, tagging Wikidata . Pinging @Addshore to have a look.

Removing task assignee due to inactivity as this open task has been assigned for more than two years. See the email sent to the task assignee on August 22nd, 2022.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome!
If this task has been resolved in the meantime, or should not be worked on ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!