This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 177402 - Test doesn't clean tmp files after run
Summary: Test doesn't clean tmp files after run
Status: CLOSED WONTFIX
Alias: None
Product: ide
Classification: Unclassified
Component: Commit Validation (show other bugs)
Version: 6.x
Hardware: Sun SunOS
: P3 normal (vote)
Assignee: Ivan Sidorkin
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2009-11-23 03:09 UTC by Michal Zlamal
Modified: 2011-06-10 08:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Zlamal 2009-11-23 03:09:08 UTC
root@beefy:/var/tmp$ls | wc
    4595    4595  141642
root@beefy:/var/tmp$ls -d TestWorkDir* | wc
    2754    2754   96059
root@beefy:/var/tmp$ls tmpbnd*.jar | wc    
     878     878   14985
root@beefy:/var/tmp$

Those file and dirs were created in about month.
Comment 1 Jesse Glick 2010-01-07 08:51:16 UTC
Causing Hudson outages, must be fixed. Are there are other filename patterns getting created?
Comment 2 Jesse Glick 2010-01-07 08:55:08 UTC
I find:

TestWorkDir*.tmp
beanTree*txt
falseProject*
fixcrlf*
hudson-remoting* [probably not our problem]
jarfscacheffjre
schematest
tmpbnd*.jar
Comment 3 Jesse Glick 2010-01-07 09:04:23 UTC
I filed https://issues.apache.org/bugzilla/show_bug.cgi?id=48506 for the fixcrlf* files, but these are probably a minor contribution in terms of size.
Comment 4 Jesse Glick 2010-01-07 10:03:33 UTC
Possible culprits (should be using NbTestCase.getWorkDir or similar):


compapp.casaeditor/test/unit/src/org/netbeans/modules/compapp/casaeditor/model/casa/TestCatalogModel.java - Util.getTempDir("schematest/catalog")

compapp.projects.jbi/test/unit/src/org/netbeans/modules/compapp/test/wsdl/TestCatalogModel.java - similar

web.beans/test/unit/src/org/netbeans/modules/web/beans/xdm/model/TestCatalogModel.java - similar

web.jsf/test/unit/src/org/netbeans/modules/web/jsf/xdm/model/TestCatalogModel.java - similar

xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/TestCatalogModel.java - similar

xml.xam.ui/test/unit/src/org/netbeans/modules/xml/xam/ui/TestCatalogModel.java - similar

xml.schema.model/test/unit/src/org/netbeans/modules/xml/schema/model/NamespaceLocation.java - Util.getTempDir("schematest")

xml.xam.ui/test/unit/src/org/netbeans/modules/xml/xam/ui/NamespaceLocation.java - similar

j2ee.sun.appsrv81/test/qa-functional/src/org/netbeans/modules/j2ee/sun/test/AdminObjectResourceMethods.java - File.createTempFile("falseProject","") [2x]

other classes in j2ee.sun.appsrv81/test/qa-functional/src/**.java - similar

java.source/test/unit/src/org/netbeans/modules/java/source/TestUtil.java - File.createTempFile("TestWorkDir", null)

schema2beans/test/unit/src/tests/MainTest.java - File.createTempFile("beanTree", "txt") [2x]


Also, outside of tests:

openide.filesystems/src/org/openide/filesystems/JarFileSystem.java - jarfscache


No apparent usages of tmpbnd; not sure where these come from.


Might benefit from a Hudson build wrapper plugin to set $TEMP to a newly created dir which is deleted as soon as the build finishes. I am not sure if such a plugin exists already, but it would not seem hard to write.
Comment 5 Jesse Glick 2010-01-07 11:52:22 UTC
http://bertram.netbeans.org/hudson/computer/beefy/script

println(new ProcessBuilder('sh', '-c', 'cd /var/tmp; perl -e "opendir D, qw(.); @fs=grep {not /^[.][.]?$/} readdir(D); closedir D; for $x (1..100) {print @fs[rand(@fs)], qq{\n}}" | xargs du -sk | sort -k1 -n').start().text)

shows TestWorkDir*.tmp and tmpbnd*.jar as the biggest problems. The latter seem to contain JRuby but I don't know what creates it.
Comment 6 Jesse Glick 2010-01-07 12:36:26 UTC
tmpbnd*.jar are left behind due to some bug in BND. I sent mail to Peter Kriens about it. Called from o.jruby/patched_source/jruby-1.1.4/build.xml due to o.jruby.distro/build.xml. This I can work around.
Comment 7 Jesse Glick 2010-01-07 13:17:50 UTC
Should have taken care of the biggest offenders in core-main #db83995c98c2 and core-main #4ef722c98ca8. I am still unsure what job is creating the TestWorkDir*.tmp folders, since these do not seem to be created by any tests in jet-main's run: 'ant -f java.source/build.xml -Dtest.config=generator'
Comment 8 Jesse Glick 2010-01-08 08:19:56 UTC
BND bug fixed upstream, and filed task for it to be shipped in JRuby: http://jira.codehaus.org/browse/JRUBY-4434
Comment 9 Quality Engineering 2010-01-09 23:40:39 UTC
Integrated into 'main-golden', will be available in build *201001100200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/db83995c98c2
User: Jesse Glick <jglick@netbeans.org>
Log: #177402 (partial): clean up stray /tmp/tmpbnd*.jar.
Comment 10 Jesse Glick 2010-01-12 08:57:50 UTC
Ant bug fixed in 1.8.0.
Comment 11 Marian Mirilovic 2011-06-10 08:57:33 UTC
too old - starting with clean table
Comment 12 Marian Mirilovic 2011-06-10 08:58:46 UTC
v/c