Skip to content

job scope bean doesn't cleanup in unit test #1288

Closed
@spring-projects-issues

Description

@spring-projects-issues

Clockrun Ren opened BATCH-2314 and commented

By using JobScopeTestExecutionListener in my test case (base on testng), I was able to instantiate job scope bean. however, after test method is executed, destroy() in job scope bean is never called.
After some investigation, I find there are issues in class JobScopeTestExecutionListener.

In method afterTestMethod, it will do JobSynchronizationManager.close(). which only remove scoped bean from context, without invoke of destroy(). if we use JobSynchronizationManager.release(), then everything is fine.


Affects: 3.0.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions