Page MenuHomePhabricator

Gerrit patches fail over seemingly unrelated `ext.wikimediaEvents` CI tests
Closed, ResolvedPublicBUG REPORT

Description

Patches are failing right now on an unrelated ext.wikimediaEvents test:

Both fail with

11:50:26 FAILED TESTS:
11:50:26   mediawiki.base/track
11:50:26     ✖ trackError
11:50:26       Firefox 140.0 (Linux 0.0.0)
11:50:26     Expected: [
11:50:26       "emit1",
11:50:26       "sub",
11:50:26       "foo",
11:50:26       "emit2",
11:50:26       "bar"
11:50:26     ]
11:50:26     Actual: [
11:50:26       "emit1",
11:50:26       "sub",
11:50:26       "{\"exception\":{},\"module\":\"ext.wikimediaEvents\",\"source\":\"module-execute\"}",
11:50:26       "foo",
11:50:26       "emit2",
11:50:26       "bar"
11:50:26     ]
11:50:26     verifySteps@node_modules/qunit/qunit/qunit.js:1626:14

(example: https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php83/54108/consoleFull)

This is unrelated to any of the changes in either patches. I'm not sure if anyone else gets this same failures as well but we cannot merge anything right now.

Event Timeline

Jdforrester-WMF triaged this task as Unbreak Now! priority.Mar 19 2026, 4:20 PM
Jdforrester-WMF subscribed.

Shared Wikimedia-deployed CI blocker -> UBN.

Change #1255781 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/core@master] mediawiki.base/track test: reset the trackQueue before each test

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

^ I believe that patch would unbreak the test, but someone should probably also track down whatever's specifically going on inside wikimediaEvents that's leaving a blank exception inside the resourceloader.exception queue.

^ I believe that patch would unbreak the test, but someone should probably also track down whatever's specifically going on inside wikimediaEvents that's leaving a blank exception inside the resourceloader.exception queue.

There is more information in the log: ERROR: 'trackError test: unexpected non-string data', Object{exception: TypeError: can't access property "getExperiment", mw.testKitchen is undefined

From the CI logs for the second patch:

Firefox 140.0 (Linux 0.0.0) LOG: 'Exception in module-execute in module ext.wikimediaEvents:'
Firefox 140.0 (Linux 0.0.0) WARN: TypeError: can't access property "getExperiment", mw.testKitchen is undefined
specialCreateAccount/experimentInstrumentation.js

The relevant lines in that file are:

ext.wikimediaEvents/specialCreateAccount/experimentInstrumentation.js
> const CREATE_ACCOUNT_FORM_V1_EXPERIMENT_NAME = 'we-1-8-account-creation-form-v1';
> const STREAM_NAME = 'mediawiki.product_metrics.contributors.experiments';
> const { ClickThroughRateInstrument } = require( 'ext.wikimediaEvents.testKitchen' );
> const experiment = mw.testKitchen.getExperiment( CREATE_ACCOUNT_FORM_V1_EXPERIMENT_NAME );
> experiment.setStream( STREAM_NAME );

// …

The problem isn't obvious but explains the error we're seeing and that it's somewhat flaky: ext.wikimediaEvents doesn't depend on ext.testKitchen (yet). There is a chance that ext.wikimediaEvents loads before ext.testKitchen and so mw.testKitchen is undefined and an error is thrown.

The fix is to wrap the parts of the experiment that require TestKitchen code in an mw.loader.using( 'ext.testKitchen' ).then( ( require ) => { } ); block.

Of course, I would prefer that WikimediaEvents depends on TestKitchen (see T419679: Make WikimediaEvents depend on TestKitchen) but we can fix this for now.

Change #1256374 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/WikimediaEvents@master] fix: add missing dependency on TestKitchen

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

Change #1256374 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] fix: add missing dependency on TestKitchen

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

Thanks all for the quick help on this!

I see the CI patches were merged, but unfortunately, our patches keep failing (on the same error)

See https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php83/54622/console
(for this patch https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaCustomizations/+/1254309 )

Is this some delayed reaction here, is it something specific, or is the fix not working?

Change #1255781 merged by jenkins-bot:

[mediawiki/core@master] mediawiki.base/track test: reset the trackQueue before each test

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

Jdforrester-WMF assigned this task to DLynch.

Optimistically calling this fixed; thanks, David, Michael, and Sam!