Last modified: 2014-04-04 15:56:22 UTC
WikiPageTest::testDoDeleteArticle, introduced Gerrit change #6415, fails: $ /usr/home/saper/bin/runphpunit.sh /usr/home/saper/public_html/pg/w/tests/phpunit/includes/WikiPageTest.php PHPUnit 3.6.10 by Sebastian Bergmann. Configuration read from /usr/home/saper/public_html/pg/w/tests/phpunit/suite.xml ..F................................................ Time: 4 seconds, Memory: 47.75Mb There was 1 failure: 1) WikiPageTest::testDoDeleteArticle pagelinks should contain no more links from the page Failed asserting that 1 matches expected 0. /usr/home/saper/public_html/pg/w/tests/phpunit/includes/WikiPageTest.php:142 /usr/home/saper/public_html/pg/w/tests/phpunit/MediaWikiTestCase.php:75 /usr/home/saper/public_html/pg/w/tests/phpunit/MediaWikiPHPUnitCommand.php:45 /usr/home/saper/public_html/pg/w/tests/phpunit/phpunit.php:103 FAILURES! Tests: 51, Assertions: 90, Failures: 1.
Looks like the deletion did not clean up `pageslinks` ? :-D Isn't Page::doDeleteArticle() supposed to do the cleanup? Are you running a master/slave setup? The `pagelinks` check is made against DB_SLAVE which might still be behind. That certainly looks like a bug in the core software.
(In reply to comment #0) > WikiPageTest::testDoDeleteArticle, introduced Gerrit change #6415, fails: Don't kill the messenger :) If the test is correct but fails on some code, that means we found a bug in the code... Good thing we have the test, no? I suggest to change the bug's description to read "doDeleteArticle() broken for PostGres". This may be a transaction isolation problem... but then, that can just as well happen in production and needs to be addressed, no?
(In reply to comment #1) > Looks like the deletion did not clean up `pageslinks` ? :-D > > Isn't Page::doDeleteArticle() supposed to do the cleanup? > > Are you running a master/slave setup? The `pagelinks` check is made against > DB_SLAVE which might still be behind. No, it's just a single machine running unit tests from the commandline.
(In reply to comment #2) > (In reply to comment #0) > > WikiPageTest::testDoDeleteArticle, introduced Gerrit change #6415, fails: > > Don't kill the messenger :) Congratulations for making the effort to write unit tests for the most basic functionality of MediaWiki... I realized today that no unit test we've had before invoked Database::insertSelect method for example... > I suggest to change the bug's description to read "doDeleteArticle() broken for > PostGres". Well it is not broken.. Doing steps from your test step-by-step in "maintenance/eval.php" does not cause any problem (and `pagelinks` are correctly empty after delete as this is done automatically via the database trigger). I suppose this is the problem with the unit test setup we have - we copy tables but we don't copy indexes and we don't copy constraints and triggers. minitest=# \d pagelinks Table "mediawiki.pagelinks" Column | Type | Modifiers --------------+----------+----------- pl_from | integer | not null pl_namespace | smallint | not null pl_title | text | not null Indexes: "pagelink_unique" UNIQUE, btree (pl_from, pl_namespace, pl_title) "pagelinks_title" btree (pl_title) Foreign-key constraints: "pagelinks_pl_from_fkey" FOREIGN KEY (pl_from) REFERENCES page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED minitest=# \d unittest_pagelinks Table "mediawiki.unittest_pagelinks" Column | Type | Modifiers --------------+----------+----------- pl_from | integer | not null pl_namespace | smallint | not null pl_title | text | not null minitest=#
Thanks Marcin! Lets focus on fixing bug 37702 so that should fix this one at the sametime.
I'm removing the milestone 1.20.0 as this only affects developers running the test suite and shouldn't block a release.