2017-05-23 15 views
0

這看起來複制的東西對SO但是我已經看過thisthisthisthis,但還沒有找到問題的解決。AssertionFailedError異常派生的Java虛擬機異常退出的不存在的測試套件

我遇到的問題是我在jenkins上得到了這個錯誤,不存在測試套件。下面是jenkins ant build log中顯示的錯誤;

compile-tests-run: 
    [junit] Testsuite: com.smartstream.control.engine.validation.Batch-With-Multiple-Tests 
    [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec 
    [junit] 
    [junit] Testcase: null took 0 sec 
    [junit]  Caused an ERROR 
    [junit] Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit. 
    [junit] junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit. 
    [junit] 
    [junit] Running com.smartstream.control.engine.validation.Batch-With-Multiple-Tests 
    [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec 

BUILD FAILED 
u:\jenkins\workspace\control.unittests.execution.time.test\build\build.xml:256: The following error occurred while executing this line: 
u:\jenkins\workspace\control.unittests.execution.time.test\engine\build\build.xml:287: Process fork failed. 

Total time: 7 minutes 42 seconds 
Build step 'Invoke Ant' marked build as failure 
Archiving artifacts 
Recording test results 
[BFA] Scanning build for known causes... 
[BFA] No failure causes found 
[BFA] Done. 0s 
Email was triggered for: Failure - Any 
Sending email for trigger: Failure - Any 
Sending email to: [email protected] 
Finished: FAILURE 

現在你可以看到它似乎是在com.smartstream.control.engine.validation.Batch-With-Multiple-Tests失敗,但是我沒有任何這樣的測試套件,在我的整個工作區。我甚至無法在項目中的任何位置找到它作爲字符串。

下面的搜索在工作區中什麼也沒有返回; enter image description here

既沒有窗戶findstr;

我試圖增加螞蟻建立內存和permgen無濟於事。該版本使用java 1.7.0_80-b15和ant 1.9.6運行。下面是engine/build.xml文件中的junit ant任務規範;

<junit dir="." haltonfailure="false" printsummary="yes" forkmode="once" fork="yes" showoutput="yes" failureproperty="tests.failed"> 
     <classpath location="${build.testclasses}" /> 
     <classpath location="${resources.dir}" /> 
     <classpath location="${common.properties}" /> 
     <classpath location="${common.libs}" /> 

     <formatter type="xml" /> 
     <formatter type="plain" usefile="false" /> 
     <jvmarg value="-Demma.coverage.out.file=${build.coveragereport}/coverage.emma" /> 
     <jvmarg value="-Demma.coverage.out.merge=true" /> 
     <jvmarg value="-Xms512m" /> 
     <jvmarg value="-Xmx1536m" /> 
     <jvmarg value="-XX:MaxPermSize=512m" /> 
     <jvmarg value="-XX:-UseSplitVerifier"/> 

     <batchtest todir="${build.report}"> 
      <fileset dir="${test.dir}"> 
       <include name="**/*Test.java" />      
       <exclude name="${excludeTestPattern1}" /> 
       <exclude name="${excludeTestPattern2}" /> 
       <exclude name="${excludeTestPattern3}" /> 
       <exclude name="${excludeTestPattern4}" /> 
       <exclude name="${excludeTestPattern5}" /> 
      </fileset> 
     </batchtest> 
    </junit> 

我已經試過到目前爲止

  • 對詹金斯的工作檢查Delete workspace before build starts一個完整乾淨的構建。
  • 初始XMX是512米我更新了它是1024米再後來1536米
  • 首次燙髮的大小爲256M,已經更新到512M
  • 已經在Ant任務與forkshowoutput屬性發揮各地
  • 更新Java和從最初嘗試的螞蟻版本

任何幫助將不勝感激。

+0

也請賜教downvote的原因。 – Setu

+0

仿真名稱'Batch-With-Multiple-Tests'由Ant生成,請參閱https://bz.apache.org/bugzilla/show_bug.cgi?id=45227#c2 – wero

+0

@wero感謝您的信息。所以你知道一種獲得關於這個失敗的更多信息的方法。 – Setu

回答

3

我找到了解決這個問題的方法。我必須爲螞蟻啓用詳細日誌記錄,並通過觀察下面的堆棧跟蹤;

Caused by: java.io.IOException: Cannot run program "u:\jenkins\tools\hudson.model.JDK\Java7\jre\bin\java.exe" (in directory "u:\jenkins\workspace\control.unittests.execution.time.test\engine"): CreateProcess error=206, The filename or extension is too long 
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047) 
    at java.lang.Runtime.exec(Runtime.java:617) 
    at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58) 
    at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428) 
    at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442) 
    at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnitTask.java:1257) 
    ... 32 more 
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long 
    at java.lang.ProcessImpl.create(Native Method) 
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:385) 
    at java.lang.ProcessImpl.start(ProcessImpl.java:136) 
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028) 
    ... 37 more 

由於詹金斯創建一個基於構建工作名稱的工作區是太長,通過它來創建虛擬機分叉。我改變了詹金斯的工作名稱,並解決了問題。

+1

我不能滿足你的要求。謝謝。對於那些想知道的你可以用「-v」標誌運行ant來獲得完整的輸出。我真的很瘋狂,直到我這樣做,才發出了這樣一個晦澀難懂的錯誤...... – JoshStrange