Page MenuHomePhabricator

Quibble jobs fail on bullseye images in QUnit job: "Multiple targets are not supported"
Closed, ResolvedPublic

Description

https://integration.wikimedia.org/ci/job/mediawiki-quibble-composer-mysql-php74/1332/console#console-section-8

00:03:26.544 04 06 2024 22:10:21.433:ERROR [launcher]: Cannot start ChromeHeadless
00:03:26.544 	[0604/221021.426451:ERROR:headless_shell.cc(266)] Multiple targets are not supported.
00:03:26.544 
00:03:26.544 04 06 2024 22:10:21.433:ERROR [launcher]: ChromeHeadless stdout: 
00:03:26.545 04 06 2024 22:10:21.433:ERROR [launcher]: ChromeHeadless stderr: [0604/221021.426451:ERROR:headless_shell.cc(266)] Multiple targets are not supported.

Chromium C code has:

chromium/chrome/app/chrome_main.cc
if (headless::IsHeadlessMode()) {
  if (command_line->GetArgs().size() > 1) {
    LOG(ERROR) << "Multiple targets are not supported in headless mode.";
    return chrome::RESULT_CODE_UNSUPPORTED_PARAM;
  }

Comes from https://chromium-review.googlesource.com/c/chromium/src/+/4160268 which was released with 111.0.5546.0.

Related Objects

Event Timeline

Change #1020314 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] karma: Configure Chromium flags as undefined not empty

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

It is also a bug in Quibble??!

def chromium_flags():
    args = [os.environ.get('CHROMIUM_FLAGS', '')]
    ...
    return ' '.join(args)

So that when CHROMIUM_FLAGS is not set, that default to an empty string which is inserted as the first element of the array. When later joined, that introduces an extra space which is further split by Chrome itself and triggers the issue.

Change #1053017 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/quibble@master] Fix "Multiple targets are not supported" with Chrome

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

I don't know how to reproduce the ERROR [launcher]: Cannot start ChromeHeadless. With Quibble 1.9.2 (ie without the patch above) and Chromium 126, the Karma manages to start the browser. I have used:

quibble --skip-zuul --skip-deps --git-cache /home/hashar/projects --run=qunit

Quibble does show the flags being passed (including the faulty empty string):

DEBUG:quibble.chromium_flags:Flags: ['', '--autoplay-policy=no-user-gesture-required', '--disable-pushstate-throttle']

Eventually I found MediaWiki uses Firefox???

Running "assert-mw-env" task

Running "karma:firefox" (karma) task
10 07 2024 10:06:03.804:WARN [config]: "/" is proxied, you should probably change urlRoot to avoid conflicts

START:
10 07 2024 10:06:03.882:INFO [karma-server]: Karma v6.4.1 server started at http://localhost:9876/
10 07 2024 10:06:03.883:INFO [launcher]: Launching browsers FirefoxHeadless with concurrency unlimited
10 07 2024 10:06:03.892:INFO [launcher]: Starting browser FirefoxHeadless

That is because grunt qunit got changed from Chrome to Firefox with https://gerrit.wikimedia.org/r/c/mediawiki/core/+/947898 . Thus I don't understand why the job mentioned in that task has failed.

I have amended MediaWiki code:

--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -160,5 +160,5 @@ module.exports = function ( grunt ) {
        } );
 
        grunt.registerTask( 'lint', [ 'eslint', 'banana', 'stylelint' ] );
-       grunt.registerTask( 'qunit', [ 'assert-mw-env', 'karma:firefox' ] );
+       grunt.registerTask( 'qunit', [ 'assert-mw-env', 'karma:chrome' ] );
 };

And surely I can reproduce now and confirmed my patch fixes it.

Change #1053252 had a related patch set uploaded (by Hashar; author: Hashar):

[mediawiki/core@master] Revert "build: Switch "npm run qunit" from chrome to firefox"

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

Change #1053252 abandoned by Hashar:

[mediawiki/core@master] Revert "build: Switch "npm run qunit" from chrome to firefox"

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

That is because grunt qunit got changed from Chrome to Firefox with https://gerrit.wikimedia.org/r/c/mediawiki/core/+/947898 . Thus I don't understand why the job mentioned in that task has failed.

Git blame gave me 2023-08-10 18:31:06 +0100 and I thus assumed that change to be rather old but that was merged on July 2nd 2024, hence a month AFTER this task got filed. Mystery solved!

Change #1053017 merged by jenkins-bot:

[integration/quibble@master] Fix "Multiple targets are not supported" with Chrome

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

Change #1053302 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/quibble@master] release: Quibble 1.9.3

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

Change #1053302 merged by jenkins-bot:

[integration/quibble@master] release: Quibble 1.9.3

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

Change #1053307 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] dockerfiles: update Quibble to 1.9.3

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

Change #1053311 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] jjb: switch jobs from Quibble 1.9.1 to 1.9.3

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

Change #1053307 merged by jenkins-bot:

[integration/config@master] dockerfiles: update Quibble to 1.9.3

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

Mentioned in SAL (#wikimedia-releng) [2024-07-10T14:00:08Z] <hashar> Switching some of the Jenkins jobs from Quibble 1.9.1 to 1.9.3 # T368783 & T366799

Change #1053311 merged by jenkins-bot:

[integration/config@master] jjb: switch jobs from Quibble 1.9.1 to 1.9.3

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

This comment was removed by hashar.

Change #1053347 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] jjb: switch php8 Quibble jobs to Bullseye

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

Fixed with Quibble 1.9.3 which no more inject an empty string to the arguments.

Change #1053347 merged by jenkins-bot:

[integration/config@master] jjb: switch php8 Quibble jobs to Bullseye

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

Change #1020314 abandoned by Hashar:

[mediawiki/core@master] karma: Configure Chromium flags as undefined not empty

Reason:

I think that is solved within Quibble with https://gerrit.wikimedia.org/r/c/integration/quibble/+/1053017

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