ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 41511] New: - junit tasks causes JVM exit while trying to delete "crashfile"
Date Wed, 31 Jan 2007 18:59:30 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41511>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41511

           Summary: junit tasks causes JVM exit while trying to delete
                    "crashfile"
           Product: Ant
           Version: 1.7.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P1
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: chwells@us.ibm.com


This problem started happening only when I switched from Ant 1.6.1 to 1.7.0.

I am using the <junit> Ant task to invoke a suite of tests for code that runs as
a J2EE application within WAS.  It successfully runs every test, but right after
it runs the last test of the suite, it exits abnormally as follows (partial
debug output shown here and it has been edited to remove confidential info):

    [junit] 'crashfile=C:\automation\scripts\junitvmwatcher935641274.properties'
    [junit] 'propsfile=C:\automation\scripts\junit370603936.properties'
    [junit]
    [junit] The ' characters around the executable and arguments are
    [junit] not part of the command.
    [junit] Running TestCase: com.ibm.<ourstuff>.<ourstuff>Tests
    [junit]     Running Test: testMethod1
    [junit]     Running Test: testMethod2
    [junit]     Running Test: testMethod3
    [junit] Tests run: 3, Failures: 0, Errors: 0, Incomplete: 0, Time elapsed: 6
.941 sec
    [junit] java.io.FileNotFoundException: C:\automation\scripts\junitvmwatcher9
35641274.properties (The system cannot find the file specified)
    [junit]     at java.io.FileInputStream.open(Native Method)
    [junit]     at java.io.FileInputStream.<init>(FileInputStream.java:129)
    [junit]     at java.io.FileReader.<init>(FileReader.java:76)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
eAsForked(JUnitTask.java:1028)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java:817)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
eOrQueue(JUnitTask.java:1657)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java:764)
    [junit]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:288)
    [junit]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [junit]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:62)
    [junit]     at java.lang.reflect.Method.invoke(Method.java:391)
    [junit]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchU
tils.java:105)
    [junit]     at org.apache.tools.ant.Task.perform(Task.java:348)
    [junit]     at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.j
ava:62)
    [junit]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:288)
    [junit]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [junit]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:62)
    [junit]     at java.lang.reflect.Method.invoke(Method.java:391)
    [junit]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchU
tils.java:105)
    [junit]     at org.apache.tools.ant.Task.perform(Task.java:348)
    [junit]     at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInst
ance.java:391)
    [junit]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:288)
    [junit]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [junit]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:62)
    [junit]     at java.lang.reflect.Method.invoke(Method.java:391)
    [junit]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchU
tils.java:105)
    [junit]     at org.apache.tools.ant.Task.perform(Task.java:348)
    [junit]     at org.apache.tools.ant.Target.execute(Target.java:357)
    [junit]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
    [junit]     at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1329)
    [junit]     at org.apache.tools.ant.Project.executeTarget(Project.java:1298)

    [junit]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.java:41)
    [junit]     at org.apache.tools.ant.Project.executeTargets(Project.java:1181
)
    [junit]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
    [junit]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
    [junit]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
    [junit]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)


After it exits, any results it has collected from the successful test method
runs has been eliminated from the XML and TXT files I had it generate, and
instead it just contains this (instead of the test results):

Testsuite: com.ibm.<ourstuff>.<ourstuff>Tests
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

Testcase: unknown took 0 sec
	Caused an ERROR
Forked Java VM exited abnormally. Please note the time in the report does not
reflect the time until the VM exit.
junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please
note the time in the report does not reflect the time until the VM exit.


Now, I have no idea what this "junitvmwatcher" file is or why it wants to delete
it.  During the test run, I watch the CWD where I started the run from (which is
c:\automation\scripts), and I see a junit*.properties file created but NOT a
junitvmwatcher*.properties file.  At the end of the test run, the
junit*.properties file is automatically deleted and the above error is generated
since it can't delete the junitvmwatcher file that does not exist.

I have no idea why it generates either of these properties file. According to
the -debug flag, this file is called a "crashfile", in case that helps figure
this out.

Oddly, the only suite of tests that fail are those that are running the J2EE
application's tests.  Other suites that do more conventional Java library tests
don't exhibit this problem.  

Observe in the output that the 3 tests I run all succeed and a summary line is
printed saying so, but then the exception happens anyway.  So, there may be many
things wrong here: 1) I don't know about this junitvmwatcher file, don't care
about it, and don't want Ant to bother me about it, 2) perhaps it failed to
create this file in the first place so that it was unable to delete it, 3) if it
never created it, it shouldn't try to delete it, 4) if it tries to delete it
anyway but fails, it really should just be quiet about it, 5) If its going to
fail catastrophically like this anyway, I still want to see the output that I
got in the TXT and XML output files -- the tests otherwise run just fine so it
shouldn't toss the results just because of a crash afterwards.

This is a blocker; I have no choice but to use Ant 1.6.1 until this is fixed or
a workaround is determined.  However, there are new Ant 1.7 features that we
really need to use.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message