JUnit plugin reports inaccurate test Age when a test fails in a @BeforeClass or @BeforeAll method

Last Reviewed:2026-03-06()
1 minute readKnowledge base

Issue

When a JUnit test fails in a @BeforeClass or @BeforeAll method, the Age column in the JUnit test report shows an inaccurate value. Instead of showing 1 (the expected age for the first failure following one or more passing builds), the test report displays a higher age value that refers back to an older failing build.

The failing test case appears with no method name in the test report, and the reported age does not reflect when the current failure began.

Resolution

Monitor Maven Surefire GitHub Issue #3267 for an upstream fix and upgrade Maven Surefire once a fix is available.

Tested product/plugin versions

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.