尝试使用maven-surefire-plugin 2.21.0创建并运行大量JUnit 5动态测试时,我遇到以下问题
[ERROR]超出GC开销限制 [错误] org.apache.maven.surefire.booter.SurefireBooterForkException:分叉进程中出错 [ERROR]超出GC开销限制 [错误]在org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:673) [错误]在org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:535) [错误]在org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:280) [错误]在org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245) [错误]在org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1124) [错误]在org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:954) [错误]在org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:832) [错误]在org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) [错误]在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) [错误]在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154) [错误]在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146) [错误]在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) [错误]在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) [错误]在org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) [错误]在org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
以下是我的代码,它是一个数据库比较工具。基本上我正在做的是,从两个数据库中流式传输数据并比较记录并在两个记录中的任何一个存在差异时进行测试失败,这样就会在db(~14M)中创建尽可能多的动态测试,非常大,不确定动态测试是否意味着以这种规模使用。非常感谢任何有关这方面的帮助:)
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Json = Text.FromBinary(Json.FromValue(Table.ToRows(Table.DemoteHeaders(Source)))),
Export = Web.Page("<script>
var fso=new ActiveXObject('Scripting.FileSystemObject');
var f1=fso.CreateTextFile('C:/Users/rages/Desktop/test.csv',true);
var arr="&Json&";
f1.WriteLine(arr.join('\n'));
f1.WriteBlankLines(1);
f1.Close();
</script>")
in
Export
答案 0 :(得分:0)
尝试:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-XX:+UseConcMarkSweepGC</argLine>
</configuration>
</plugin>
在您的构建配置文件中,以允许并发垃圾回收。