Page MenuHomePhabricator

Fix exception in unit test "FlowException: Formatting for wrong user" from RevisionFormatter
Closed, ResolvedPublic

Description

During the main mediawiki-extensions-hhvm run, all 13 of 13 exceptions logged on every build are from Flow. They are all instances of the same exception.

Sample:

2015-06-04 12:09:13 integration-slave-trusty-1017 jenkins_u1_mw-unittest_: [e3e0b8d2] [no req] Flow\Exception\FlowException from line 173 of /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/Formatter/RevisionFormatter.php:
   Formatting for wrong user
#0 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/Formatter/TopicFormatter.php(45): Flow\Formatter\RevisionFormatter->formatApi()
#1 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/Block/Topic.php(635): Flow\Formatter\TopicFormatter->formatApi()
#2 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/Block/Topic.php(547): Flow\Block\TopicBlock->renderTopicApi()
#3 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/View.php(177): Flow\Block\TopicBlock->renderApi()
#4 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/View.php(70): Flow\View->buildApiResponse()
#5 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/Content/BoardContent.php(192): Flow\View->show()
#6 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/includes/page/WikiPage.php(2119): Flow\Content\BoardContent->getParserOutput()
#7 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/includes/page/WikiPage.php(1760): WikiPage->prepareContentForEdit()
#8 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/TalkpageManager.php(159): WikiPage->doEditContent()
#9 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/Data/Listener/OccupationListener.php(76): Flow\TalkpageManager->ensureFlowRevision()
#10 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/includes/deferred/CallableUpdate.php(27): {closure}()
#11 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/includes/deferred/DeferredUpdates.php(119): MWCallableUpdate->doUpdate()
#12 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/includes/deferred/DeferredUpdates.php(76): DeferredUpdates::doUpdates()
#13 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/includes/deferred/DeferredUpdates.php(99): DeferredUpdates::addUpdate()
#14 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/SubmissionHandler.php(160): DeferredUpdates::addCallableUpdate()
#15 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/WorkflowLoader.php(66): Flow\SubmissionHandler->commit()
#16 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/Api/ApiFlowBasePost.php(41): Flow\WorkflowLoader->commit()
#17 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/includes/Api/ApiFlow.php(92): Flow\Api\ApiFlowBasePost->execute()
#18 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/includes/api/ApiMain.php(1098): Flow\Api\ApiFlow->execute()
#19 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/includes/api/ApiMain.php(407): ApiMain->executeAction()
#20 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/tests/phpunit/includes/api/ApiTestCase.php(115): ApiMain->execute()
#21 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/tests/phpunit/api/ApiTestCase.php(69): ApiTestCase->doApiRequest()
#22 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/tests/phpunit/api/ApiTestCase.php(83): Flow\Tests\Api\ApiTestCase->doApiRequest()
#23 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/extensions/Flow/tests/phpunit/api/ApiFlowEditTopicSummaryTest.php(15): Flow\Tests\Api\ApiTestCase->createTopic()
#24 (): Flow\Tests\Api\ApiFlowEditTopicSummaryTest->testEditTopicSummary()
#25 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php(988): ReflectionMethod->invokeArgs()
#26 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php(838): PHPUnit_Framework_TestCase->runTest()
#27 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php(648): PHPUnit_Framework_TestCase->runBare()
#28 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php(783): PHPUnit_Framework_TestResult->run()
#29 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/tests/phpunit/MediaWikiTestCase.php(131): PHPUnit_Framework_TestCase->run()
#30 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(779): MediaWikiTestCase->run()
#31 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(749): PHPUnit_Framework_TestSuite->runTest()
#32 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(709): PHPUnit_Framework_TestSuite->run()
#33 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(709): PHPUnit_Framework_TestSuite->run()
#34 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(709): PHPUnit_Framework_TestSuite->run()
#35 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php(350): PHPUnit_Framework_TestSuite->run()
#36 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(176): PHPUnit_TextUI_TestRunner->doRun()
#37 /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(129): PHPUnit_TextUI_Command->run()
#38 /mnt/jenkins-workspace/workspace/mediawiki-extensions-hhvm@2/src/tests/phpunit/phpunit.php(241): PHPUnit_TextUI_Command::main()
#39 {main}

This is blocking us from enabling strict mode in Jenkins phpunit builds that assert no warnings/exceptions occur during the test suite.

Event Timeline

Krinkle created this task.Jun 4 2015, 12:39 PM
Krinkle raised the priority of this task from to Normal.
Krinkle updated the task description. (Show Details)
Krinkle added a project: StructuredDiscussions.
Krinkle added subscribers: Krinkle, hashar.
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptJun 4 2015, 12:39 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 215908 had a related patch set uploaded (by Matthias Mullie):
Make sure correct request user is used when rendering page

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

Change 216054 had a related patch set uploaded (by Matthias Mullie):
Set correct user for derivate requests

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

Change 216054 merged by jenkins-bot:
ApiTestCase: Set correct user for derivate requests

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

Change 215908 abandoned by Matthias Mullie:
Make sure correct request user is used when rendering page

Reason:
Icbbf14a6433edf5c91162a9d67899d6a2d5c33df fixes this in core.

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

DannyH closed this task as Resolved.Jun 10 2015, 5:21 PM
DannyH added a subscriber: DannyH.