Last modified: 2012-01-30 17:41:17 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 T31493, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29493 - Put parser fuzz tests in @group and disable by default
Put parser fuzz tests in @group and disable by default
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Antoine "hashar" Musso (WMF)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-19 17:54 UTC by Chad H.
Modified: 2012-01-30 17:41 UTC (History)
4 users (show)

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


Attachments

Description Chad H. 2011-06-19 17:54:24 UTC
Right now all of the fuzz tests are being skipped due to excess memory usage. They should be given a new @group (was thinking MemoryHungry) and disabled by default.

That way we can test them without killing ci.tesla :)

(I may get to this in the next few days, just filing a bug so I don't forget or if anyone's feeling bored)
Comment 1 Brion Vibber 2011-06-20 17:49:27 UTC
How memory hungry are we talking? Does the limit just need to be more appropriately set, or are they like runaway memory leak breakage territory that need to be fixed?
Comment 2 Chad H. 2011-06-21 00:07:21 UTC
Not really memory hungry at all. The reason they crashed OOM was because testFuzzTests() went and set the memory limit for no real reason that I could tell.

They actually fail for a completely different reason which I clarified in r90483. Repurposing bug based on that. Example output below:

1) ParserTests::testFuzzTests
PDOException: You cannot serialize or unserialize PDO instances

/www/phase3/tests/phpunit/includes/parser/NewParserTest.php:661
/www/phase3/tests/phpunit/includes/parser/NewParserTest.php:611
/www/phase3/tests/phpunit/MediaWikiTestCase.php:60
/www/phase3/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/www/phase3/tests/phpunit/phpunit.php:60
Comment 3 Brion Vibber 2011-06-23 17:53:23 UTC
Heh... looks like getMemoryBreakdown() attempts to estimate size of various objects by running them through serialization. This apparently fails in exciting ways with the PDO objects used by DatabaseSQLite, whereas I guess the MySQL resources we use get "serialized" without error.

This gets called apparently between every 100 tests if we see that we've used up 90% of an arbitrary 50MB soft memory limit.

So... if it's getting called, it would already have been on the way to throwing an exception anyway (which would come with the approx memory breakdown).

Probably needs a fix to getMemoryBreakdown to not die on unserializable things, so it at least sends through the rest of the data, but it's still apparently hitting that limit as reported by memory_get_usage(true).
Comment 4 Platonides 2011-10-25 20:46:45 UTC
Doing fuzz tests in an infinite loop amongst other normal tests doesn't seem the right design.
Comment 5 Antoine "hashar" Musso (WMF) 2011-10-26 11:50:51 UTC
Xdebug does not like this test!

$ ./phpunit.php --tap --filter FuzzTests includes/parser/NewParserTest.php
Fatal error: Maximum function nesting level of '200' reached, aborting!
<snip: Call Stack>

There is a faulty recursion somewhere in our code :-(
Comment 6 Rob Lanphier 2012-01-10 19:32:56 UTC
I've asked Antoine to do what Chad suggested in comment 1, which is to give it a @group and disable by default.  There's lots of discussion about actually fixing the test which is a lower priority bug that I don't want to stick him with.
Comment 7 Antoine "hashar" Musso (WMF) 2012-01-10 20:51:20 UTC
Fuzzing tests are now in the ParserFuzz group with r108547.

Jenkins updated to exclude the group.
Comment 8 Antoine "hashar" Musso (WMF) 2012-01-30 17:41:17 UTC
Closing bug since I have fixed it already :)

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


Navigation
Links