Page MenuHomePhabricator

Flaky unit test "TemplateCategoriesTest::testTemplateCategories"
Open, LowPublic


This test has been failing intermittently for the past few weeks.

00:06:06.242 There was 1 failure:
00:06:06.242 1) TemplateCategoriesTest::testTemplateCategories
00:06:06.242 Verify that the page is no longer in the category after template deletion
00:06:06.242 Failed asserting that two arrays are equal.
00:06:06.243 --- Expected
00:06:06.243 +++ Actual
00:06:06.243 @@ @@
00:06:06.243  Array (
00:06:06.243 +    'Category:Solved_bugs_2' => 'Categorized from template'
00:06:06.243  )
00:06:06.243 /home/jenkins/workspace/mediawiki-phpunit-php55-trusty/src/tests/phpunit/includes/TemplateCategoriesTest.php:93
00:06:06.243 /home/jenkins/workspace/mediawiki-phpunit-php55-trusty/src/tests/phpunit/MediaWikiTestCase.php:402
00:06:06.243 /home/jenkins/workspace/mediawiki-phpunit-php55-trusty/src/maintenance/doMaintenance.php:111

The test suite itself has not been modified in years, so it's likely an indirect problem caused by a behaviour change in JobQueue, which it uses. The problem is basically that it makes an edit, and observes that a page becomes a member of a certain category. Since this logic is deferred through jobs, it needs to force a job queue run, which doesn't seem to work consistently.

		$title = Title::newFromText( "Categorized from template" );
		$page = WikiPage::factory( $title );
		$page->doEditContent( .. );

		$template = WikiPage::factory( Title::newFromText( 'Template:Categorising template' ) );
		$template->doEditContent( .. );

		// Run the job queue
		$jobs = new RunJobs;
		$jobs->loadParamsAndArgs( null, [ 'quiet' => true ], null );

		// Make sure page is in the category
			[ .. ],

@aaron Any ideas perhaps?

Event Timeline

Change 354669 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] Disable broken TemplateCategoriesTest unit test

Change 354669 merged by jenkins-bot:
[mediawiki/core@master] Disable broken TemplateCategoriesTest unit test

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:10 PM
Krinkle changed the subtype of this task from "Production Error" to "Task".