 
             rewind.hls_segmenter.once "_finalizer", ->
                 setTimeout ->
-                    expect(injector_pushes).to.eql 5
-                    expect(rewind.hls_segmenter.finalizer.segments).to.have.length 5
+
+                    expect(injector_pushes).to.be.within 4,5
+                    expect(rewind.hls_segmenter.finalizer.segments).to.have.length.within 4,5
                     done()
                 , 200
 

            seq = 5
            seg_map = {}
            for i in [0..2]
                seg_map[ Number(f_seg.ts) + i*segment_duration ] = seq
                seq += 1

            finalizer = new HLSSegmenter.Finalizer (new Logger {}),
                segmentSeq:         8

                expect(finalizer.segments).to.have.length 4

                for seg in finalizer.segments
                    if seg.id < 8
                        map_id = seg_map[ Number( seg.ts ) ]
                        expect(map_id).to.not.be.undefined
                        expect(seg.id).to.eql map_id

                    else
                        expect(seg.id).to.eql 8

                done()

