1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Limit allocation.

This commit is contained in:
Vladimir Mihailenco
2016-11-09 10:04:37 +02:00
parent b6bfe529a8
commit 62cd3b38ef
3 changed files with 41 additions and 16 deletions

View File

@ -104,7 +104,9 @@ var _ = Describe("races", func() {
})
It("should handle big vals in Get", func() {
bigVal := string(bytes.Repeat([]byte{'*'}, 1<<17)) // 128kb
C, N = 4, 100
bigVal := bytes.Repeat([]byte{'*'}, 1<<17) // 128kb
err := client.Set("key", bigVal, 0).Err()
Expect(err).NotTo(HaveOccurred())
@ -115,7 +117,7 @@ var _ = Describe("races", func() {
perform(C, func(id int) {
for i := 0; i < N; i++ {
got, err := client.Get("key").Result()
got, err := client.Get("key").Bytes()
Expect(err).NotTo(HaveOccurred())
Expect(got).To(Equal(bigVal))
}
@ -124,7 +126,8 @@ var _ = Describe("races", func() {
It("should handle big vals in Set", func() {
C, N = 4, 100
bigVal := string(bytes.Repeat([]byte{'*'}, 1<<17)) // 128kb
bigVal := bytes.Repeat([]byte{'*'}, 1<<17) // 128kb
perform(C, func(id int) {
for i := 0; i < N; i++ {