Last modified: 2012-07-18 15:50:56 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 T35987, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33987 - PHPUnit test suite leaks temporary data
PHPUnit test suite leaks temporary data
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Antoine "hashar" Musso (WMF)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-27 13:53 UTC by Chad H.
Modified: 2012-07-18 15:50 UTC (History)
5 users (show)

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


Attachments

Description Chad H. 2012-01-27 13:53:59 UTC
/tmp on gallium keeps getting filled up with junk because tests aren't cleaning up after themselves.

Running MediaWiki-sqlite-phpunit && MediaWiki-postgres-phpunit suites *once* takes leaves /tmp with ~43M more data spread across ~1560 directories. After a couple of runs, /tmp ends up with 32000+ directories and jenkins craps out.

Tests should clean their messes up after themselves. Aaron: you said this was better but obviously not so I added you to cc :)
Comment 1 Aaron Schulz 2012-01-27 17:05:48 UTC
It should be better for the two test I worked on. I didn't say anything about the other tests :D
Comment 2 Antoine "hashar" Musso (WMF) 2012-01-28 10:21:40 UTC
We talked about that with Platonides some days ago. A possible way would be to create a temporary file repository for each test and have it destroy itself automatically through a __destructor call.

Still need to figure out how to create a FileRepo object though :-D
Comment 3 Chad H. 2012-01-30 20:05:42 UTC
This seems to be much better since a few days ago :) Current status of gallium:

* exif tests are still leaking, although they use way less directories than the filerepo tests so it's not as urgent
* Something (filerepo?) is leaving various *.png, *.jpg files behind
* Something is leaving files behind named /randomfile![0-9]{19}.txt/
* Also some txt files called "unittests_{git-looking-hash}-1.txt" are being left too

Other than that, much much better!
Comment 4 Antoine "hashar" Musso (WMF) 2012-02-08 15:47:25 UTC
I have started enhancing the test suite to use TempFSFile  (a self destructing filesystem).
Comment 5 Antoine "hashar" Musso (WMF) 2012-02-24 20:50:09 UTC
I have attempted again a temp filesystem but that does not work that well. Ended up hacking in.

Leaks in trunk with r112327 r112352

Merged back to REL1_19 with r112354

Still have to cleanup the "new" parser tests leakages.
Comment 6 Antoine "hashar" Musso (WMF) 2012-03-16 08:18:41 UTC
Just checked again on gallium. After 4 weeks, there is just some mwParser and exif-test directories.
Comment 7 Antoine "hashar" Musso (WMF) 2012-04-20 12:18:05 UTC
Christian Aistleitner factored a nice interface in MediaWikiTestCase which offer temp file and temp directory that self destruct.

https://gerrit.wikimedia.org/r/4637
Comment 8 Chad H. 2012-06-01 20:26:55 UTC
*** Bug 37252 has been marked as a duplicate of this bug. ***
Comment 9 Chad H. 2012-06-01 20:27:16 UTC
Seems to be not fixed 100% per the dupe.
Comment 10 Umherirrender 2012-06-15 19:46:26 UTC
(In reply to comment #9)
> Seems to be not fixed 100% per the dupe.

FAILURES!
FileBackendTest::testRecursiveClean
Dir mwstore://localtesting/unittest-cont1/a no longer exists (FSFileBackend).
Failed asserting that true matches expected false.

\tests\phpunit\includes\filerepo\FileBackendTest.php:1121
\tests\phpunit\includes\filerepo\FileBackendTest.php:1075
\tests\phpunit\MediaWikiTestCase.php:79
\tests\phpunit\MediaWikiPHPUnitCommand.php:45
\tests\phpunit\phpunit.php:103

On an windows machine
Comment 11 Umherirrender 2012-06-15 22:37:08 UTC
Getting "Permission denied" but dir is empty, when trying to remove it. Looks like someone is still having a handler open on that dir (maybe php bug 42948?)
Comment 12 Antoine "hashar" Musso (WMF) 2012-07-18 15:50:56 UTC
reclosing. Better to just open a new bug.  Dupe bug 37252 fixed.

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


Navigation
Links