close(stopChan)

				time.Sleep(time.Millisecond * 50)
				writes = atomic.LoadUint32(&writer.count)
				Expect(writes).To(BeNumerically(">", 40))
				Expect(writes).To(BeNumerically("<", 60))
			})
		})
	})

	Context("BurstWriteStrategy", func() {
		Describe("StartWriter", func() {
			var (
				writer        mockWriter
				stopChan      chan struct{}
				writeStrategy *writestrategies.BurstWriteStrategy
				params        writestrategies.BurstParameters
			)

			BeforeEach(func() {
				writer = mockWriter{}
				stopChan = make(chan struct{})
				params = writestrategies.BurstParameters{
					Minimum:   10,
					Maximum:   100,
					Frequency: 900 * time.Millisecond,
				}
				writeStrategy = writestrategies.NewBurstWriteStrategy(&mockGenerator{}, &writer, params)
			})

			It("writes messages in bursts", func() {
				writeStrategy.Stop()

				time.Sleep(time.Millisecond * 50)
				writes = atomic.LoadUint32(&writer.count)
				Expect(writes).To(BeNumerically(">", 40))
				Expect(writes).To(BeNumerically("<", 60))
			}, 1)
		})
	})

	Context("BurstWriteStrategy", func() {
		Describe("StartWriter", func() {
			var (
				writer        mockWriter
				writeStrategy *writestrategies.BurstWriteStrategy
				params        writestrategies.BurstParameters
			)

			BeforeEach(func() {
				writer = mockWriter{}
				params = writestrategies.BurstParameters{
					Minimum:   10,
					Maximum:   100,
					Frequency: 900 * time.Millisecond,
				}

			})

			JustBeforeEach(func() {
				writeStrategy = writestrategies.NewBurstWriteStrategy(&mockGenerator{}, &writer, params)