Skip to content

Commit 5b9717c

Browse files
committed
test: add test for fix config-ops
1 parent 26ab782 commit 5b9717c

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

tests/integration/server_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,31 @@ var _ = Describe("Server", func() {
418418
Expect(configRewrite.Err()).NotTo(HaveOccurred())
419419
Expect(configRewrite.Val()).To(Equal("OK"))
420420
})
421+
422+
// Test for cache-value-item-max-size & max-key-size-in-cache
423+
It("should handle cache size configurations correctly", func() {
424+
configGet := client.ConfigGet(ctx, "cache-value-item-max-size")
425+
Expect(configGet.Err()).NotTo(HaveOccurred())
426+
Expect(configGet.Val()).To(HaveKey("cache-value-item-max-size"))
427+
428+
configGet2 := client.ConfigGet(ctx, "max-key-size-in-cache")
429+
Expect(configGet2.Err()).NotTo(HaveOccurred())
430+
Expect(configGet2.Val()).To(HaveKey("max-key-size-in-cache"))
431+
432+
configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024")
433+
Expect(configSet1.Err()).NotTo(HaveOccurred())
434+
Expect(configSet1.Val()).To(Equal("OK"))
435+
436+
configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576")
437+
Expect(configSet2.Err()).NotTo(HaveOccurred())
438+
Expect(configSet2.Val()).To(Equal("OK"))
439+
440+
configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size")
441+
Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024"))
442+
443+
configGet4 := client.ConfigGet(ctx, "max-key-size-in-cache")
444+
Expect(configGet4.Val()["max-key-size-in-cache"]).To(Equal("1048576"))
445+
})
421446
//It("should DBSize", func() {
422447
// Expect(client.Set(ctx, "key", "value", 0).Val()).To(Equal("OK"))
423448
// Expect(client.Do(ctx, "info", "keyspace", "1").Err()).NotTo(HaveOccurred())

0 commit comments

Comments
 (0)