在推送新代码时,在org.pitest:mutationCoverage目标期间,我的CI构建失败。我的补丁集没有任何源代码的更改(只是一个新的空提交),但是打印了以下错误:

16:49:26 [ERROR] Failed to execute goal org.pitest:pitest-maven:1.4.0:mutationCoverage (default) on project common-scheduler: Execution default of goal org.pitest:pitest-maven:1.4.0:mutationCoverage failed: Input byte array has wrong 4-byte ending unit -> [Help 1]
16:49:26 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.pitest:pitest-maven:1.4.0:mutationCoverage (default) on project common-scheduler: Execution default of goal org.pitest:pitest-maven:1.4.0:mutationCoverage failed: Input byte array has wrong 4-byte ending unit
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
16:49:26     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
16:49:26     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
16:49:26     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
16:49:26     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
16:49:26     at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
16:49:26     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
16:49:26     at java.lang.reflect.Method.invoke (Method.java:497)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
16:49:26 Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.pitest:pitest-maven:1.4.0:mutationCoverage failed: Input byte array has wrong 4-byte ending unit
16:49:26     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
16:49:26     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
16:49:26     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
16:49:26     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
16:49:26     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
16:49:26     at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
16:49:26     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
16:49:26     at java.lang.reflect.Method.invoke (Method.java:497)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
16:49:26 Caused by: java.lang.IllegalArgumentException: Input byte array has wrong 4-byte ending unit
16:49:26     at java.util.Base64$Decoder.decode0 (Base64.java:704)
16:49:26     at java.util.Base64$Decoder.decode (Base64.java:526)
16:49:26     at java.util.Base64$Decoder.decode (Base64.java:549)
16:49:26     at org.pitest.mutationtest.incremental.ObjectOutputStreamHistoryStore.deserialize (ObjectOutputStreamHistoryStore.java:126)
16:49:26     at org.pitest.mutationtest.incremental.ObjectOutputStreamHistoryStore.restoreResults (ObjectOutputStreamHistoryStore.java:101)
16:49:26     at org.pitest.mutationtest.incremental.ObjectOutputStreamHistoryStore.initialize (ObjectOutputStreamHistoryStore.java:87)
16:49:26     at org.pitest.mutationtest.tooling.MutationCoverage.runReport (MutationCoverage.java:132)
16:49:26     at org.pitest.mutationtest.tooling.EntryPoint.execute (EntryPoint.java:116)
16:49:26     at org.pitest.mutationtest.tooling.EntryPoint.execute (EntryPoint.java:49)
16:49:26     at org.pitest.maven.RunPitStrategy.execute (RunPitStrategy.java:35)
16:49:26     at org.pitest.maven.AbstractPitMojo.analyse (AbstractPitMojo.java:436)
16:49:26     at org.pitest.maven.AbstractPitMojo.execute (AbstractPitMojo.java:377)
16:49:26     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
16:49:26     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
16:49:26     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
16:49:26     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
16:49:26     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
16:49:26     at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
16:49:26     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
16:49:26     at java.lang.reflect.Method.invoke (Method.java:497)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
16:49:26 [ERROR]
16:49:26 [ERROR]
16:49:26 [ERROR] For more information about the errors and possible solutions, please read the following articles:
16:49:26 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
16:49:26 [ERROR]
16:49:26 [ERROR] After correcting the problems, you can resume the build with the command
16:49:26 [ERROR]   mvn <goals> -rf :common-scheduler
16:49:26 Build step 'Invoke top-level Maven targets' marked build as failure
16:49:26 Archiving artifacts


我为PiTest启用了详细日志记录,为maven启用了调试日志记录,但日志中没有任何内容。
也无法在线看到与此错误类似的东西。

插件配置为:

<plugin>
  <groupId>org.pitest</groupId>
  <artifactId>pitest-maven</artifactId>
  <version>1.4.0</version>
  <configuration>
    <analyseLastCommit>true</analyseLastCommit>
    <avoidCallsTo>
      <avoidCallsTo>org.slf4j</avoidCallsTo>
    </avoidCallsTo>
    <excludedClasses>
      <param>*Exception</param>
    </excludedClasses>
    <excludedMethods>
      <param>toString</param>
      <param>hashCode</param>
      <param>equals</param>
      <param>getInstance</param>
    </excludedMethods>
    <failWhenNoMutations>false</failWhenNoMutations>
    <outputFormats>xml,html</outputFormats>
    <skip>${skip-pitest}</skip>
    <withHistory>true</withHistory>
  </configuration>
</plugin>


我正在努力了解错误的出处,因为它似乎根本不与任何代码更改相关,但每个新补丁集都在发生。

最佳答案

在github上为PiTest提出了一个问题:
https://github.com/hcoles/pitest/issues/629

问题是损坏的历史记录文件。清理环境并再次运行以解决问题。

09-11 04:51