Exemplo n.º 1
0
			}
			wg.Wait()
		})

		It("should incr", func() {
			key := "TestIncrFromGoroutines"
			wg := &sync.WaitGroup{}
			for i := 0; i < C; i++ {
				wg.Add(1)

				go func() {
					defer GinkgoRecover()
					defer wg.Done()

					for j := 0; j < N; j++ {
						err := client.Incr(key).Err()
						Expect(err).NotTo(HaveOccurred())
					}
				}()
			}
			wg.Wait()

			val, err := client.Get(key).Int64()
			Expect(err).NotTo(HaveOccurred())
			Expect(val).To(Equal(int64(C * N)))
		})

	})

})