Bug 65219 - [EasyHack] unit tests fail to clean up temp files
Summary: [EasyHack] unit tests fail to clean up temp files
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.2.0
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks:
 
Reported: 2013-05-31 17:20 UTC by Michael Stahl (CIB)
Modified: 2017-02-14 08:57 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stahl (CIB) 2013-05-31 17:20:32 UTC
apparently some of the tests that run during the build leave files in /tmp that they really should delete.

somebody should find out which tests are responsible for that and which cleanup function needs to be called.
Comment 1 Michael Stahl (CIB) 2013-05-31 17:22:46 UTC
to narrow down the culprits build individual modules, then comment out some of the CppunitTests in Module_*.mk and finally investigate the source of the tests that are responsible (look at the CppunitTest_*.mk files to find the cxx source files).
Comment 2 Markus Mohrhard 2013-06-27 18:16:31 UTC
Miklos fixed already a large number of these leaked files during the hackfest:

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c03a1e46460e4255d7709df9ba8147947f66acfb
Comment 3 Björn Michaelsen 2013-10-04 18:48:10 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 4 Jass 2014-08-24 02:59:59 UTC
I am interested in working on this. I am a beginner in C++ (university student) and new to LibreOffice, and open source in general. Is there a primary contact I can reach out to if I need some pointers/help?

Thanks a lot!
Comment 5 David Tardon 2014-08-24 08:14:32 UTC
(In reply to comment #4)
> Is there a primary contact I can reach out to if I need some pointers/help?

The best way is to ask on IRC: #libreoffice-dev on FreeNode.
Comment 6 chaitanya7991@gmail.com 2015-10-20 19:32:19 UTC
I would like to fix this bug.
Comment 7 Robinson Tryon (qubit) 2015-12-13 10:58:04 UTC Comment hidden (obsolete)
Comment 8 Robinson Tryon (qubit) 2016-02-18 14:51:59 UTC Comment hidden (obsolete)
Comment 9 Aleksas Pantechovskis 2016-03-05 22:00:13 UTC
I fixed two temp file leaks in sw tests, submitted patch to gerrit.

There is one more leak left in sw/qa/extras/uiwriter.cxx SwUiWriterTest::testEmbeddedDataSource but I do not know how to fix it.
I found that the leaked file is created after executing these lines: 

    uno::Reference<sdbc::XDataSource> xDataSource(xDatabaseContext->getByName("calc-data-source"), uno::UNO_QUERY);
    CPPUNIT_ASSERT(xDataSource.is());
    uno::Reference<sdbcx::XTablesSupplier> xConnection(xDataSource->getConnection("", ""), uno::UNO_QUERY);

but I do not see anything related to disposal in XComponentContext or XDataSource.
Comment 10 Aleksas Pantechovskis 2016-03-06 14:50:22 UTC
I fixed temp file leaks in sc tests, now make sc.check does not leave any temp files. Submitted patch to gerrit.
Comment 11 Commit Notification 2016-03-07 12:18:46 UTC
Aleksas Pantechovskis committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=14c14094e8587d28eb9cd2a3b5c0c57b355635b5

tdf#65219 Fix temp files clean up in sc unit tests

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Aleksas Pantechovskis 2016-03-07 14:30:23 UTC
I fixed temp file leaks in sd tests, submitted patch to gerrit.

There are two more leaks left in sd/qa/unit/mist-tests.cxx, but so I have not figured out how to fix it yet.
As far as I identified the file is created after executing this line:
  xSSController.GetClipboard().DoPaste();
Comment 13 Commit Notification 2016-03-07 20:29:27 UTC
Aleksas Pantechovskis committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=123b41c3870810d61fde5e17c74a352e3fd2a694

tdf#65219 Fix temp files clean up in sw unit tests

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2016-03-17 16:04:18 UTC
Aleksas Pantechovskis committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=080f355f11ee3422e9512815efd9f8d7eb896d32

tdf#65219 Fix temp files clean up in sd unit tests

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 jani 2016-05-05 05:58:36 UTC
Seems solved