我有6项技术正在进行
easyB硒Gradle蚂蚁Java语言詹金斯
我们使用easyB编写场景
这些场景反过来调用Selenium
最后,我们使用Gradle来启动所有故事。由于我们没有针对easyB的gradle插件,gradle实际上使用ant来运行easyB。
这个Gradle脚本最终通过Jenkins作业执行
整个执行过程大约需要3-4个小时。中途,我们得到perm-gen错误
我不确定哪个过程需要PermGen 中的增加
EasyB?蚂蚁Gradle?
错误消息
[ant:asyb]重试值现在为:2
[ant:asyb]objectID设置为:60868
[ant:asyb]创建subjectID 60868后中断
[ant:asyb]创建就诊>>>>>预处理
[ant:asyb]创建映像组>>>>>>auto-gp1
[ant:asyb]运行easyb故事或规范时出错
[ant:asyb]java.lang.OutOfMemoryError:PermGen空间
[ant:asyb]easyb执行失败
失败:生成失败,出现异常。
渐变脚本
check << {
def script = new GroovyShell()
script.run(new File('InitializeReport.groovy'))
ant.taskdef(name: "easyb", classname:"org.easyb.ant.BehaviorRunnerTask", classpath: sourceSets.test.runtimeClasspath.asPath)
ant.easyb( classpath: sourceSets.test.runtimeClasspath.asPath, failureProperty:'easyb_failed' ,tags:tags) {
report( location:"${project.testResultsDir}/story."+format, format:format )
behaviors( dir: storiesHome ) {
include( name:storyToBeExecuted )
}
}
ant.fail( if:'easyb_failed', message: 'Failures in easyb stories' )
}
这就是我在Jenkins控制台上看到的请注意,内存选项是如何传递给Gradle命令的,而不是传递给运行easyB脚本的Java命令的?这就是问题所在…
[jenkins@bil-dev-006vbin]$ps-ef|grep渐变
詹金斯18420 4714 9 23:04?00:00:16/usr/java/jdk1.6.0_20/bin/java-XX:MaxPermSize=700m-Xmx512m-XX:Max PermSize=800m-Xmx512 m-classpath/opt/jenkins/gradle-1.0-milestone-1/lib/gradle-launcher-1.0-milestone 1.jar-Dorg.gradle.appname=gradle org.gradle-launcher.GradleMain-PstoryName=-PstoriesHome=check-info
詹金斯18579 18420 13 23:04?00:00:21/usr/java/jdk1.6.0_20/jre/bin/java-类路径/jenkin/jobs/hez-complete-run/workspace/ttrunk/build/classes/main:/jenkin/jobs/hez-fully-run/workplace/ttrunk/lib/commons-lang-2.4.jar:/jenks/jobs/hey-complete-run/vorkspace/trunk/lib/httpclient-4.1.1.jar:/jankins/jobs/hele-complete-run/workspace/tlunk/lib/xml-apis.jar:/jenkins/jobs/hez-complete run/workspace/ttrunk/lb/activation.jar/trunk/lib/xercesSamples.jar:/jenkin/jobs/hez-complete-run/workspace/trunk/lib/safe-client。jar:/jankins/jobs/hey-complete-run/trunk/lib/security.jar:/jenkins/jobs/hez-complete run/workplace/trunk/lib/json-lib-2.4-jdk15。jar:/jenkin/jobs/hez-fully-run/workspace/trunk-lib/http-builder-0.5.1.jar:/詹金斯/jobs/hee-complete-run/workspace/ttrunk/lib/safe-importobs/hez-complete-run/workspace/ttrunk/lib/mail.jar:/jenkin/jobs/hez-fully-run/workplace/ttrunk-lib/ojdbc14。jar:/jepkins/jobs/hey-complete-run/vorkspace/trunk/lib/xercesImpl。jar:/jenkins/jobs/hez-complete run/workspace/ttrunk/lb/cacher.jar:/jankins/jobs/hee-complete-run/workspace/tTRUnk/lib/serializer.jar:/jenkins/jobs/hez-complete-run/workspace/ttrunk/lib/resolv.jar:/jenkins/jobs/hele-complete-run/workspace/trunk/lib/cache verifier.jar:/opt/jenkns/.gradle/cache.org/easyb/easyb-0.9.7.jar:/opt/jerkins/.gradle/cache/commons-cli/commons-cacher/jars/commons-cli-1.1.jar:/opp/jenkins/.gradle-cache/org.codehaus.groovy/groovy all/jars/groovy-all--1.7.2.jar.eselenium.client driver/selenium-java客户端驱动程序/jars/selenium-java-client-driver-1.0.1。jar:/opt/jenkins/.gradle/cache/log4j/bundles/log4j-1.2.16。jar:/opt/jerkins/.ggradle/cache/orgCodehaus.groovy/jars/grooovy-1.8.2。jar:/opt/jenkins/.gradle-cache/antlr/antlr/jars/antlr-2.7.7。jar:/opt/jenkns/.gradle/cache/asm/ars/asm-3.2。asm/asm-commons/jars/asm-commons-3.2.jar:/opt/jenkins/.gradle/cache/asm/asm-tree/jars/asm-tree-3.2.jar:/opp/jenkins/.gradle-cache/asm/util/jars-asm-util-3.2.jaer:/opt/jerkins/.ggradle/cache/asm/asm-annalysis/jars.asm-analysis-3.2.jar org.easyb.BBehaviorRunner-outfailed.txt-html/jenkins/works/trunk/build/test-results/storycaseassignment_inter-intra.html/jenkins/jobs/heyme-complete-run/workspace/ttrunk/src/test/stores/caseassignment/inter-inter/ca_interentra.story
您需要增加perm-gen空间,可以通过VM设置设置最大参数来实现。在命令行上,使用以下选项启动Java:
-XX: 最大PermSize=128米
另请参阅:http://www.freshblurbs.com/explaining-java-lang-outofmemoryerror-permgen-space
按照您实现它的方式,easyB测试将在"main"Gradle JVM中运行(除非easyB-Ant任务派生出一个新的JVM,我对此表示怀疑。)将JVM选项传递给该进程的一种方法是通过GRADLE_OPTS
环境变量:
export GRADLE_OPTS="-XX:MaxPermSize=128m"
设置此选项的其他方法是properties.gradle
(有关详细信息,请参阅Gradle用户指南)或调整gradlew
脚本(如果您碰巧使用Gradle包装器)。