Skip to content

Incorrect thread usage in SynchronizedItemStreamReaderTests #837

Closed
@spring-projects-issues

Description

@spring-projects-issues

Dimitrios Liapis opened BATCH-2767 and commented

While working on the PR for BATCH-2752 I found out that SynchronizedItemStreamReaderTests and SynchronizedItemStreamReaderBuilderTests have the following issue: 

The test threads are not properly started but rather their run method gets invoked

 I've addressed this issue and also performed some refactoring.

Few points about the approach followed:

  • using an atomic integer to track access to the read method
  • using a CountDownLatch to get all the threads ready
  • using assertion within the read method (closely paired with the atomic integer above)

Referenced from: pull request #666

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions