-
Bug
-
Resolution: Fixed
-
Minor
-
3.5.8, 3.6.6, 3.7.2, 3.8
-
MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
-
master_
MDL-66973 -
1. Overview
- search_simpledb_testsuite testsuite has it's own declaration of tearDown() method, so parent's one is overwritten and therefore \core_privacy\local\request\writer::reset() can't be called;
- search_simpledb_testsuite leaves data in Content writer singleton;
- tool_monitor_privacy_testcase extends advanced_testcase and doesn't have tearDown() method;
- tool_monitor_testsuite testsuite asserts that Content writer singleton has no data and fails.
2. How to replicate
root@62c474b27a92:/siteroot#./vendor/bin/phpunit --testsuite search_simpledb_testsuite,tool_monitor_testsuite |
Moodle 3.7.2+ |
(Build: 20191018), aac11a3c4beac3b24b5a769e83b0ced2a044e243 |
Php:7.2.19.0.0.18.04.1, pgsql: 11.4 (Debian 11.4-1.pgdg90+1), OS: Linux 4.15.0-65-generic x86_64 |
PHPUnit 7.5.15 by Sebastian Bergmann and contributors. |
|
...............................F........................ 56 / 56 (100%) |
|
Time: 17.61 seconds, Memory: 100.50 MB |
|
There was 1 failure: |
|
1) tool_monitor_privacy_testcase::test_export_user_data |
Failed asserting that true is false. |
|
/siteroot/admin/tool/monitor/tests/privacy_test.php:202 |
/siteroot/lib/phpunit/classes/advanced_testcase.php:80 |
|
To re-run: vendor/bin/phpunit "tool_monitor_privacy_testcase" admin/tool/monitor/tests/privacy_test.php |
|
FAILURES!
|
Tests: 56, Assertions: 366, Failures: 1. |
3. Why it's been missed
Normally PHPUnit sorts testsuits, so all of them are running in the same order all the time.
It's been missed because between search_simpledb_testsuite and tool_monitor_testsuite there are other testsuits that reset Content writer singleton properly before tool_monitor_testsuite gets started.