Page MenuHomePhabricator

Selenium tests need to restart php7.2 or 7.4 depending on the version used in the job
Closed, ResolvedPublicBUG REPORT

Description

The Homepage saves change tags for unstructured task edits made via VisualEditor is broken (or flaky?) on wmf.26. See e.g.
https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/827534/
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ConfirmEdit/+/827203/

Noting that only the PHP 7.4 (not 7.2) job is failing, and we have this specific hack hardcoding 7.2:

tests/selenium/wdio.conf.js
		// This is needed in Quibble + Apache (T225218) because we use supervisord to control
		// the php-fpm service, and with supervisord you need to restart the php-fpm service
		// in order to load updated php code.
		if ( process.env.QUIBBLE_APACHE ) {
			await childProcess.spawnSync(
				'service',
				[ 'php7.2-fpm', 'restart' ]
			);
			// Super ugly hack: Run this twice because sometimes the first invocation hangs.
			await childProcess.spawnSync(
				'service',
				[ 'php7.2-fpm', 'restart' ]
			);
		}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 827564 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/GrowthExperiments@wmf/1.39.0-wmf.26] Temporarily disable change tag test

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

The test times out on return await HomepagePage.suggestedEditsCardTitle.getText() === copyeditArticle. It requires both an article fixture and a LocalSettings fixture, so one of those could have gone wrong, or maybe the card really doesn't appear for some reason.

Change 827564 merged by Clare Ming:

[mediawiki/extensions/GrowthExperiments@wmf/1.39.0-wmf.26] Temporarily disable change tag test

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

Mentioned in SAL (#wikimedia-operations) [2022-08-29T21:08:42Z] <cjming@deploy1002> Synchronized php-1.39.0-wmf.26/extensions/GrowthExperiments/tests/selenium/specs/homepage.js: Backport: [[gerrit:827564|Temporarily disable change tag test (T316596)]] (duration: 03m 49s)

Disabled in wmf.26 but not on master; we should decide what (if anything) needs to be done about it since wmf.27 will be cut soon.

Change 827569 had a related patch set uploaded (by Kosta Harlan; author: Gergő Tisza):

[mediawiki/extensions/GrowthExperiments@wmf/1.39.0-wmf.27] Temporarily disable change tag test

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

kostajh triaged this task as High priority.Aug 30 2022, 8:42 AM

Seems that MediaWiki:NewcomerTasks.json is not getting imported correctly anymore:

[GrowthExperiments] The configuration title does not exist.
#0 /workspace/src/extensions/GrowthExperiments/includes/NewcomerTasks/TaskSuggester/LocalSearchTaskSuggesterFactory.php(66): GrowthExperiments\NewcomerTasks\TaskSuggester\TaskSuggesterFactory->createError(StatusValue)
#1 /workspace/src/extensions/GrowthExperiments/includes/NewcomerTasks/TaskSuggester/DecoratingTaskSuggesterFactory.php(54): GrowthExperiments\NewcomerTasks\TaskSuggester\LocalSearchTaskSuggesterFactory->create(NULL)
#2 /workspace/src/extensions/GrowthExperiments/includes/HomepageHooks.php(842): GrowthExperiments\NewcomerTasks\TaskSuggester\DecoratingTaskSuggesterFactory->create()
#3 /workspace/src/includes/deferred/MWCallableUpdate.php(38): GrowthExperiments\HomepageHooks->GrowthExperiments\{closure}()
#4 /workspace/src/includes/deferred/DeferredUpdates.php(474): MWCallableUpdate->doUpdate()
#5 /workspace/src/includes/deferred/DeferredUpdates.php(399): DeferredUpdates::attemptUpdate(MWCallableUpdate, Wikimedia\Rdbms\LBFactorySimple)
#6 /workspace/src/includes/deferred/DeferredUpdates.php(214): DeferredUpdates::run(MWCallableUpdate, Wikimedia\Rdbms\LBFactorySimple, MediaWiki\Logger\LegacyLogger, BufferingStatsdDataFactory, MediaWiki\JobQueue\JobQueueGroupFactory, string)
#7 /workspace/src/includes/deferred/DeferredUpdatesScope.php(267): DeferredUpdates::{closure}(MWCallableUpdate, integer)
#8 /workspace/src/includes/deferred/DeferredUpdatesScope.php(196): DeferredUpdatesScope->processStageQueue(integer, integer, Closure)
#9 /workspace/src/includes/deferred/DeferredUpdates.php(235): DeferredUpdatesScope->processUpdates(integer, Closure)
#10 /workspace/src/includes/MediaWiki.php(679): DeferredUpdates::doUpdates(NULL, integer)
#11 /workspace/src/includes/api/ApiMain.php(901): MediaWiki::preOutputCommit(DerivativeContext)
#12 /workspace/src/includes/api/ApiMain.php(846): ApiMain->executeActionWithErrorHandling()
#13 /workspace/src/api.php(90): ApiMain->execute()
#14 /workspace/src/api.php(45): wfApiMain()
#15 {main}

Change 827959 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] selenium: Adjust set up code

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

Noting that only the PHP 7.4 (not 7.2) job is failing, and we have this specific hack hardcoding 7.2:

tests/selenium/wdio.conf.js
		// This is needed in Quibble + Apache (T225218) because we use supervisord to control
		// the php-fpm service, and with supervisord you need to restart the php-fpm service
		// in order to load updated php code.
		if ( process.env.QUIBBLE_APACHE ) {
			await childProcess.spawnSync(
				'service',
				[ 'php7.2-fpm', 'restart' ]
			);
			// Super ugly hack: Run this twice because sometimes the first invocation hangs.
			await childProcess.spawnSync(
				'service',
				[ 'php7.2-fpm', 'restart' ]
			);
		}

Noting that only the PHP 7.4 (not 7.2) job is failing, and we have this specific hack hardcoding 7.2:

tests/selenium/wdio.conf.js
		// This is needed in Quibble + Apache (T225218) because we use supervisord to control
		// the php-fpm service, and with supervisord you need to restart the php-fpm service
		// in order to load updated php code.
		if ( process.env.QUIBBLE_APACHE ) {
			await childProcess.spawnSync(
				'service',
				[ 'php7.2-fpm', 'restart' ]
			);
			// Super ugly hack: Run this twice because sometimes the first invocation hangs.
			await childProcess.spawnSync(
				'service',
				[ 'php7.2-fpm', 'restart' ]
			);
		}

Well-spotted. That would explain it. Some options:

  • add an alias in the Quibble image so that php-fpm resolves to php7.{2,4}-fpm
  • set an environment variable in jjb and check that in the code and call php7.2-fpm or php7.4-fpm as needed
kostajh renamed this task from GrowthExperiments change tags test broken on wmf.26 branch to Selenium tests need to restart php7.2 or 7.4 depending on the version used in the job.Aug 30 2022, 9:12 AM
kostajh added a project: PHP 7.4 support.
kostajh updated the task description. (Show Details)

Looks like we have PHP_VERSION=7.4 in the environment variables, so we can use that to update the Selenium test code.

Change 827962 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] selenium: Use php-fpm version from PHP_VERSION environment

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

taavi raised the priority of this task from High to Unbreak Now!.Aug 30 2022, 11:02 AM

(UBN! as this is actively blocking the current train)

Change 827982 had a related patch set uploaded (by Sohom Datta; author: Sohom Datta):

[mediawiki/extensions/ProofreadPage@master] Make phpfpm restart, php version agnostic

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

Change 827962 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] selenium: Use php-fpm version from PHP_VERSION environment

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

Change 827572 had a related patch set uploaded (by Majavah; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@wmf/1.39.0-wmf.27] selenium: Use php-fpm version from PHP_VERSION environment

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

Change 827573 had a related patch set uploaded (by Majavah; author: Sohom Datta):

[mediawiki/extensions/ProofreadPage@wmf/1.39.0-wmf.27] Make phpfpm restart, php version agnostic

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

Change 827982 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@master] Make phpfpm restart, php version agnostic

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

Change 827573 merged by Majavah:

[mediawiki/extensions/ProofreadPage@wmf/1.39.0-wmf.27] Make phpfpm restart, php version agnostic

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

Change 827572 merged by Majavah:

[mediawiki/extensions/GrowthExperiments@wmf/1.39.0-wmf.27] selenium: Use php-fpm version from PHP_VERSION environment

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

Change 827569 abandoned by Kosta Harlan:

[mediawiki/extensions/GrowthExperiments@wmf/1.39.0-wmf.27] Temporarily disable change tag test

Reason:

not needed anymore

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

kostajh lowered the priority of this task from Unbreak Now! to Needs Triage.Aug 30 2022, 4:27 PM

No longer UBN, I believe, as fixes have been merged to master, wmf.26 and wmf.27.

Thanks all for your work on this! Is this now Resolved?

Thanks all for your work on this! Is this now Resolved?

The immediate issue is, there's still a patch on here that needs code review.

kostajh changed the task status from Open to In Progress.Sep 16 2022, 12:45 PM
kostajh triaged this task as Medium priority.

Change 827959 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] selenium: Adjust set up code and logging

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

Urbanecm_WMF changed the task status from In Progress to Open.Oct 20 2022, 12:51 PM