Skip to content

Commit 81733b9

Browse files
committed
add test
1 parent 8c5cb8e commit 81733b9

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tests/integration/server_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,30 @@ var _ = Describe("Server", func() {
792792
Expect(adminCmdList).To(ContainSubstring("ping"))
793793
Expect(adminCmdList).To(ContainSubstring("monitor"))
794794
})
795+
// fix: verify that shared block cache does not cause double counting of block cache metrics
796+
It("should report correct block cache capacity when share-block-cache is yes", func() {
797+
// Verify share-block-cache is enabled
798+
shareBlockCacheConfig := client.ConfigGet(ctx, "share-block-cache")
799+
Expect(shareBlockCacheConfig.Err()).NotTo(HaveOccurred())
800+
Expect(shareBlockCacheConfig.Val()).To(Equal(map[string]string{"share-block-cache": "yes"}))
801+
802+
info := client.Info(ctx, "rocksdb")
803+
Expect(info.Err()).NotTo(HaveOccurred())
804+
infoStr := info.Val()
805+
806+
Expect(infoStr).To(ContainSubstring("strings_block_cache_capacity:"))
807+
Expect(infoStr).To(ContainSubstring("hashes_block_cache_capacity:"))
808+
Expect(infoStr).To(ContainSubstring("lists_block_cache_capacity:"))
809+
Expect(infoStr).To(ContainSubstring("sets_block_cache_capacity:"))
810+
Expect(infoStr).To(ContainSubstring("zsets_block_cache_capacity:"))
811+
812+
// Simple string-based verification that values are present
813+
Expect(infoStr).To(MatchRegexp(`strings_block_cache_capacity:\d+`))
814+
Expect(infoStr).To(MatchRegexp(`hashes_block_cache_capacity:\d+`))
815+
Expect(infoStr).To(MatchRegexp(`lists_block_cache_capacity:\d+`))
816+
Expect(infoStr).To(MatchRegexp(`sets_block_cache_capacity:\d+`))
817+
Expect(infoStr).To(MatchRegexp(`zsets_block_cache_capacity:\d+`))
818+
})
795819

796820
// fix add auth command to admin-thread-pool
797821
It("should process auth command in admin thread pool", func() {

0 commit comments

Comments
 (0)