Skip to content

ChunkIterator: last chunk item will be used two times. #3

Open

Description

@stevleibelt

If you have chunks like this:

1-10
10-20
20-30

The last chunk id of the previous chunk will be used two times (10, 20 and so one).

note: reported originally by dirkwinkhause.

Activity

  1. stevleibelt commented on Jun 25, 2016

    @stevleibelt
    MemberAuthor

    I can confirm this issue with the following phpunit test.

        public function testThatNoChunkIsEverProcessedMoreThanOnce()
        {
            $chunkIterator      = $this->getNewCollectionChunkIterator();
            $expectedChunks     = array(
                0 => array(0, 9),
                1 => array(10, 19),
                2 => array(20, 29),
                3 => array(30, 30)
            );
    
            $chunkIterator->initialize(30, 0, 10);
    
            foreach ($chunkIterator as $index => $chunk) {
                $expectedMaximum    = $expectedChunks[$index][1];
                $expectedMinimum    = $expectedChunks[$index][0];
    
                $this->assertEquals($expectedMaximum, $chunk->maximum());
                $this->assertEquals($expectedMinimum, $chunk->minimum());
            }
        }
  2. added a commit that references this issue on Jun 25, 2016
  3. stevleibelt commented on Jun 25, 2016

    @stevleibelt
    MemberAuthor

    Fixed in commit 72bd9c1 and in the upcoming release 1.10.0.

  4. added this to the 1.10.0 milestone on Jun 25, 2016
  5. self-assigned this
    on Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions