                         # snapshot we exported, since the Injector doesn't see
                         # that the last segment should be finalized (no data
                         # pushed beyond the end_ts)
-                        expect(snap2.segments).to.have.length 11
+                        expect(snap2.segments).to.have.length snap1.segments.length - 1
 
                         done()
 

            injector.pipe(finalizer)

            finalizer.on "finish", ->
                expect(finalizer.segments).to.have.length 4
                expect(finalizer.segments[0].id).to.eql 5
                expect(finalizer.segments[1].id).to.eql 6
                expect(finalizer.segments[2].id).to.eql 7
                expect(finalizer.segments[3].id).to.eql 8

                done()



            rewind.hls_segmenter.once "_finalizer", ->
                setTimeout ->

                    expect(injector_pushes).to.be.within 4,5
                    expect(rewind.hls_segmenter.finalizer.segments).to.have.length.within 4,5
                    done()
                , 200

