ExportXMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor
    • None
    • Environment:
      - Jenkins 2.580.2 (Debian package, native systemd unit), OpenJDK 21
      - junit 1456.vdb_4425ca_0d4d (updated 2026-11-10), flaky-test-handler 1.3.172.v35b_30de7fa_5b_, workflow-job 1622.vc41c189cb_e5f

      Pipeline step
        junit testDataPublishers: [junitFlakyTestPublisher()], testResults: 'V2Presentation/target/surefire-reports/TEST-*.xml'
      Surefire runs with -Dsurefire.rerunFailingTestsCount=3, so most builds have retried tests.

      Symptom
      Every build of this job that has at least one entry in testCaseFlakyInfoMap disappears from the build history: the job page lists only builds without flaky data, the build URL returns 404, and allBuilds via the REST API omits them. 23 consecutive builds over six days are affected. Their build.xml files are complete on disk (about 900 KB each). Builds without flaky entries load normally.

      Controller log when such a build is accessed:

        WARNING hudson.model.RunMap retrieve: could not load /var/lib/jenkins/jobs/selenium/jobs/pipeline/builds/4209
        com.thoughtworks.xstream.security.ForbiddenClassException: java.time.Duration
        Caused: jenkins.util.xstream.CriticalXStreamException:
        ---- Debugging information ----
        cause-exception     : com.thoughtworks.xstream.security.ForbiddenClassException
        cause-message       : java.time.Duration
        class               : com.google.jenkins.flakyTestHandler.plugin.JUnitFlakyTestData
        required-type       : com.google.jenkins.flakyTestHandler.plugin.JUnitFlakyTestData
        converter-type      : hudson.util.RobustReflectionConverter
        path                : /flow-build/actions/hudson.tasks.junit.TestResultAction/testData/com.google.jenkins.flakyTestHandler.plugin.JUnitFlakyTestData/testCaseFlakyInfoMap/entry[3]/com.google.jenkins.flakyTestHandler.junit.FlakyClassResult/parent/duration
        line number         : 15590
        Caused: java.io.IOException: Unable to read /var/lib/jenkins/jobs/selenium/jobs/pipeline/builds/4209/build.xml
          at hudson.XmlFile.unmarshal(XmlFile.java:199)
          at org.jenkinsci.plugins.workflow.job.WorkflowRun.reload(WorkflowRun.java:559)
          at hudson.model.Run.<init>(Run.java:352)
          at jenkins.model.lazy.LazyBuildMixIn.loadBuild(LazyBuildMixIn.java:178)
          at hudson.model.RunMap.retrieve(RunMap.java:261)

      Builds recorded before the junit plugin update load fine; the first unreadable one was recorded the day after it. So the FlakyClassResult's parent now carries a java.time.Duration, which Jenkins' JEP-200 class filter does not allow, and the whole run record is rejected rather than just that field.

      Expected
      Build records remain loadable. Either the flaky-test data should not persist a java.time.Duration, or the class should be on the allowlist.

      Workaround
      -Dhudson.remoting.ClassFilter=java.time.Duration on the controller JVM, per the JEP-200 guidance; the records are intact and load again after a restart.

       

      Note: build.xml of an affected build contains no occurrence of the string "java.time.Duration".
      The rejected type is therefore resolved from a field declaration in the current classes
      (path .../FlakyClassResult/parent/duration), not from a class attribute in the data, so the
      record is refused regardless of which plugin version wrote it. Builds whose
      testCaseFlakyInfoMap is empty load normally. Downgrading not tried.

            Assignee:
            Steve Peters
            Reporter:
            jonathan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: