Last modified: 2014-04-04 15:56:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T38759, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 36759 - WikiPageTest::testDoDeleteArticle fails on PostgreSQL
WikiPageTest::testDoDeleteArticle fails on PostgreSQL
Status: NEW
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 37702
Blocks: postgres 37600
  Show dependency treegraph
 
Reported: 2012-05-11 11:18 UTC by Marcin Cieślak
Modified: 2014-04-04 15:56 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Marcin Cieślak 2012-05-11 11:18:50 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.
Comment 1 Antoine "hashar" Musso (WMF) 2012-06-18 12:49:04 UTC
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.
Comment 2 Daniel Kinzler 2012-06-18 13:03:47 UTC
(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?
Comment 3 Marcin Cieślak 2012-06-18 17:36:55 UTC
(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.
Comment 4 Marcin Cieślak 2012-06-18 20:43:05 UTC
(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=#
Comment 5 Antoine "hashar" Musso (WMF) 2012-06-18 21:05:08 UTC
Thanks Marcin! Lets focus on fixing bug 37702 so that should fix this one at the sametime.
Comment 6 Tim Landscheidt 2012-09-25 18:18:47 UTC
I'm removing the milestone 1.20.0 as this only affects developers running the test suite and shouldn't block a release.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links