Page MenuHomePhabricator

Exploratory testing on PHP 8.3 for MediaWiki Platform Team components
Closed, ResolvedPublic

Description

This task is a blocker for WE6.4.2 (FY25-26 Q1), as tracked by the parent task T360995: Migrate Wikimedia production from PHP 8.1 to PHP 8.3.

  • QTE, MW, SRE: Validation and end-to-end testing, especially areas not covered by CI.

This testing step is the last phase before SRE may start the rollout and send (a percentage of) live web requests in production to the PHP 8.3 containers.

This task represents the testing for MediaWiki Platform Team components as listed on mw:Maintainers. It is up to the team to judge and decide what components warrant testing at this stage, and what/how much testing to do.

MediaWiki core:

  • Authentication and Authorization
  • BagOStuff
  • Benchmarker
  • Notifications
  • Profiler
  • ResourceLoader
  • StatsLib

MediaWiki extensions:

  • CentralAuth
  • OATHAuth
  • OAuth
  • OAuthRateLimiter
  • WebAuthn

MediaWiki libs:

  • wikimedia/cssjanus
  • OOjs (not PHP)
  • jquery-client (not PHP)
  • wikimedia/less.php
  • wikimedia/minify
  • wikimedia/php-session-serializer
  • wikimedia/relpath
  • wikimedia/wrappedstring

Misc service-level components:

  • php-excimer
  • poolcounter (not PHP)

How to test:

  • Enable WikimediaDebug in your browser and choose the k8s-mwdebug-next option. This routes wikipedia.org and wikimedia.org requests from your browser to the new MediaWiki containers that run PHP 8.3 instead of PHP 8.1.
  • Report any problems under T401855: ☂ PHP 8.3 issues found during WMF rollout, via the button on that task.
  • Even if you see no problems in the user interface, check the Logstash: mwdebug for any errors during your debug session. For example, non-fatal errors (such as PHP Deprecation, PHP Notice, and PHP Warning messages), and post-send exceptions (such as via a DeferredUpdate) would not show in the user interface, but are reported to Logstash.
  • We will by default delay the rollout until subtasks of T401855 are resolved. If an issue you found is considered non-blocking, please leave a comment on the subtask in question.

Once your team is satisfied with testing and has discovered any issues you want to discover before rollout, feel free to close this task.

Related Objects

Event Timeline

T384232: QA for SUL3 on testwikis has a checklist for testing the auth stack that can be reused.

I've ticked off the libaries (BagOStuff, StatsLib, cssjanus, less.php, minify, relpath, wrappedstring) because they:

  • have ~100% test coverage in CI,
  • and their CI runs on all supported PHP versions (8.1, 8.2, 8.3, and 8.4),
  • and have no untested configuration options, subclasses, events, or hooks that we use in production,
  • and are low level components that have no user journey of their own - they power other features instead.

I've also ticked off Profiler because I covered that in T400109: Ensure MediaWiki-Core-Profiler works with php-xhprof 2.x (PHP 8.3). That was locally rather than in prod, but that's good enough for a debug tool.

Finished testing for ResourceLoader via WikimediaDebug on PHP 8.3 with browser caching disabled in devtools:

LGTM.

Finished testing of php-excimer by loading https://en.wikipedia.org/wiki/Special:Version.

LGTM.

Change #1185122 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] benchmarks: Fix deprecated ContentRenderer::getParserOutput in benchmarkParse.php

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

Ticked off Benchmarker. Tested locally on PHP 8.3. Note that this is a component specifically for CLI use. (There is no web UI in prod, e.g. via WikimediaDebug).

Tested as follows:

$ php maintenance/benchmarks/
README.md                      benchmarkHooks.php             benchmarkLruHash.php           benchmarkSanitizer.php         benchmarkTitleValue.php        
benchmarkCommentFormatter.php  benchmarkJsValidate.php        benchmarkParse.php             benchmarkSettings.php          benchmarkTruncate.php          
benchmarkEval.php              benchmarkJsonCodec.php         benchmarkPurge.php             benchmarkTidy.php              data/                      

$ php maintenance/benchmarks/benchmarkEval.php -e 'ucfirst("foo");' --inner 10_000 --count 200 

Running PHP version 8.3.24 (arm64) on Darwin 24.4.0 …

eval
   count: 200
    rate:   4545.2/s
   total:    44.00ms
    mean:     0.22ms
     max:     0.26ms
  stddev:     0.01ms
Current memory usage: 20.00 MiB
   Peak memory usage: 20.00 MiB

$ php maintenance/benchmarks/benchmarkLruHash.php 

Running PHP version 8.3.24 (arm64) on Darwin 24.4.0 …

HashBagOStuff::__construct
   count: 1000
    rate: 1060238.6/s
   total:     0.94ms
    mean:     0.00ms
     max:     0.00ms
  stddev:     0.00ms
Current memory usage: 20.00 MiB
   Peak memory usage: 20.00 MiB

MapCacheLRU::__construct
   count: 1000
    rate: 5777278.2/s
   total:     0.17ms
    mean:     0.00ms
     max:     0.00ms
  stddev:     0.00ms
Current memory usage: 20.00 MiB
   Peak memory usage: 20.00 MiB



HashBagOStuff::get
   count: 1000
    rate:   3896.7/s
   total:   256.63ms
    mean:     0.26ms
     max:     0.31ms
  stddev:     0.01ms
Current memory usage: 20.00 MiB
   Peak memory usage: 20.00 MiB

MapCacheLRU::get
   count: 1000
    rate:   5672.9/s
   total:   176.28ms
    mean:     0.18ms
     max:     0.22ms
  stddev:     0.01ms
Current memory usage: 20.00 MiB
   Peak memory usage: 20.00 MiB

$ php maintenance/benchmarks/benchmarkTitleValue.php --count=100000

Running PHP version 8.3.24 (arm64) on Darwin 24.4.0 …

BenchmarkTitleValue::constructTitleValue()
   count: 100000
    rate: 2146840.6/s
   total:    46.58ms
    mean:     0.00ms
     max:     0.03ms
  stddev:     0.00ms
Current memory usage: 20.00 MiB
   Peak memory usage: 20.00 MiB

BenchmarkTitleValue::constructTitle()
   count: 100000
    rate: 1531175.8/s
   total:    65.31ms
    mean:     0.00ms
     max:     0.02ms
  stddev:     0.00ms
Current memory usage: 20.00 MiB
   Peak memory usage: 20.00 MiB

$ php maintenance/benchmarks/benchmarkParse.php Main_Page                                               

CPU time = 0.003 s, wall clock time = 0.127 s

$ php maintenance/benchmarks/benchmarkTidy.php           

24 MB

Run 2: 104.77948188782
50.5 MB

Run 3: 102.95639038086
56.5 MB

Run 4: 103.82349491119
64.5 MB

Run 5: 103.08699607849
70.5 MB

Run 6: 103.78789901733
78.5 MB

Run 8: 103.75008583069
92.5 MB

106.5 MB
Run 10: 103.7367105484

Minimum: 102.9461145401 ms
Median: 103.74339818954 ms
Mean: 104.36684608459 ms
Maximum: 111.1142873764 ms
Memory usage: 106.5 MB
Peak memory usage: 106.5 MB

I think we can skip Notifications and OAuthRateLimiter which don't do anything interesting (from the POV of changing PHP features), and php-session-serializer (which does interesting things but has 100% test coverage).

We should probably test the patch for T363639: web-auth/webauthn-lib must be upgraded to 4+ for PHP 8.2+ support though (once it's done) - it adds a bunch of new libraries which involve encryption and such.

Change #1185122 merged by jenkins-bot:

[mediawiki/core@master] benchmarks: Fix deprecated ContentRenderer::getParserOutput in benchmarkParse.php

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

Krinkle assigned this task to Tgr.
Krinkle updated the task description. (Show Details)

Thanks!