Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
3.11.5, 4.0
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_311_STABLE
-
MDL-73834_311 -
Description
While working on MDL-73826 it was detected that mod/lti/tests/locallib.php unit tests are too slow (> 4 minutes). It seems that practically all the time is spent sort of "waiting" with this 4 tests (one minute each):
$ vendor/bin/phpunit mod/lti/tests/locallib_test.php --testdox -v
|
Moodle 3.11.5+ (Build: 20220208), 34b5b416393a5163a3273f298b2ab916ad126755
|
Php: 8.0.15, pgsql: 13.5, OS: Darwin 20.6.0 x86_64
|
PHPUnit 9.5.13 by Sebastian Bergmann and contributors.
|
|
Runtime: PHP 8.0.15
|
Configuration: /Users/stronk7/git_moodle/moodle/phpunit.xml
|
|
locallib_test (mod_lti\locallib_test)
|
...
|
...
|
...
|
✔ Lti get launch data default organizationid unset usehost [60410.68 ms]
|
✔ Lti get launch data default organizationid set usehost [60401.39 ms]
|
✔ Lti get launch data default organizationid set usesiteid [60440.08 ms]
|
✔ Lti get launch data default organizationid orgid override [60394.67 ms]
|
...
|
...
|
Ideally, we should be able to be in the ms range instead of 1 minute.
Updated description of the problem and the fix, after all the research (from commit message):
Summary:
- With PHP7, libxml_disable_entity_loader() was making those
flags futile, and the DTDs were not being requested ever.- With PHP8, the flags get precedence and requests for the
DTD have started to happen.- Those requests are not served by W3C (1 minute time-out).
- Those DTDs aren't used by anything in code (no entity
replacement, no validation...)Hence:
- Remove the flags so it will work the same in PHP7 and PHP8.
- Just to double ensure we don't want any remote loading
to happen ever, add explicitly the LIBXML_NONET flag.
Ciao
Attachments
Issue Links
- Discovered while testing
-
MDL-73826 Better handling of lti_load_cartridge() empty responses
-
- Closed
-