Skip to content

Exceptions in junit AfterAll / AfterClass are not reported as error since 3.5.5Β #3412

Closed

Description

@XN137

Affected version

3.5.5+

Bug description

see comment

the integration test added in #3338
documents the current (faulty?) behavior.

reverting b4a53de brings back the old behavior of reporting class teardown issues as errors.

why this matters:

  • a lot of test infrastructure can do important things on class teardown i.e. check for resource leaks, clean up for the next test etc.
  • even if intentional such a behavior change should not be introduced in a patch version imo

also note that when rerunFailingTestsCount > 0 passing tests are getting rerun on class teardown errors.

Activity

  1. added
    bugSomething isn't working
    on Aug 5, 2026
  2. XN137 commented on Aug 11, 2026

    @XN137
    ContributorAuthor

    thanks for the fix, but i am wondering:
    shouldnt this also get backported to surefire-3.5.x ?

  3. olamy commented on Aug 13, 2026

    @olamy
    Member

    thanks for the fix, but i am wondering: shouldnt this also get backported to surefire-3.5.x ?

    sounds like a good idea see there #3427
    please have a test and let us know if this is fixing your issue with 3.5.x branch

  4. XN137 commented on Aug 17, 2026

    @XN137
    ContributorAuthor

    please have a test and let us know if this is fixing your issue with 3.5.x branch

    since the fix copied the integration tests i had suggested for reproducing this problem, i am quite confident the issue has been addressed.
    i will wait for the next 3.5.x release to confirm once more on our codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions