-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Pika Quality #3194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Pika Quality #3194
Changes from 2 commits
96dc69b
fc15f01
a28b82a
cff22a6
85701cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| package pika_integration | ||
|
|
||
| import ( | ||
| "net" | ||
| . "github.com/bsm/ginkgo/v2" | ||
| . "github.com/bsm/gomega" | ||
| ) | ||
|
|
||
| var _ = Describe("Telnet", func() { | ||
| Describe("core dump fix", func() { | ||
| It("should handle empty commands without crashing (telnet core dump fix)", func() { | ||
| conn, err := net.Dial("tcp", SINGLEADDR) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| defer conn.Close() | ||
|
|
||
| _, err = conn.Write([]byte("\n")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
|
|
||
| _, err = conn.Write([]byte("*1\r\n$4\r\nPING\r\n")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
|
|
||
| buf := make([]byte, 1024) | ||
| n, err := conn.Read(buf) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| response := string(buf[:n]) | ||
| Expect(response).To(ContainSubstring("+PONG")) | ||
|
|
||
| _, err = conn.Write([]byte("*2\r\n$4\r\nECHO\r\n$4\r\nTEST\r\n")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
|
|
||
| n, err = conn.Read(buf) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| response = string(buf[:n]) | ||
| Expect(response).To(ContainSubstring("$4\r\nTEST")) | ||
| }) | ||
|
|
||
| It("should handle multiple empty commands without crashing", func() { | ||
| conn, err := net.Dial("tcp", SINGLEADDR) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| defer conn.Close() | ||
|
|
||
| for i := 0; i < 5; i++ { | ||
| _, err = conn.Write([]byte("\r\n")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| } | ||
|
|
||
| _, err = conn.Write([]byte("*1\r\n$4\r\nPING\r\n")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
|
|
||
| buf := make([]byte, 1024) | ||
| n, err := conn.Read(buf) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| response := string(buf[:n]) | ||
| Expect(response).To(ContainSubstring("+PONG")) | ||
| }) | ||
| }) | ||
| }) |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -434,6 +434,31 @@ var _ = Describe("Server", func() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expect(configRewrite.Err()).NotTo(HaveOccurred()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expect(configRewrite.Val()).To(Equal("OK")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Test for cache-value-item-max-size & max-key-size-in-cache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| It("should handle cache size configurations correctly", func() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| configGet := client.ConfigGet(ctx, "cache-value-item-max-size") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expect(configGet.Err()).NotTo(HaveOccurred()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expect(configGet.Val()).To(HaveKey("cache-value-item-max-size")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| configGet2 := client.ConfigGet(ctx, "max-key-size-in-cache") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expect(configGet2.Err()).NotTo(HaveOccurred()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expect(configGet2.Val()).To(HaveKey("max-key-size-in-cache")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expect(configSet1.Err()).NotTo(HaveOccurred()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expect(configSet1.Val()).To(Equal("OK")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expect(configSet2.Err()).NotTo(HaveOccurred()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Expect(configSet2.Val()).To(Equal("OK")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size") | |
| configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size") | |
| Expect(configGet3.Err()).NotTo(HaveOccurred()) |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.
| configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024") | |
| Expect(configSet1.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet1.Val()).To(Equal("OK")) | |
| configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576") | |
| Expect(configSet2.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet2.Val()).To(Equal("OK")) | |
| configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size") | |
| Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024")) | |
| configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024") | |
| Expect(configSet1.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet1.Val()).To(Equal("OK")) | |
| configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576") | |
| Expect(configSet2.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet2.Val()).To(Equal("OK")) | |
| configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size") | |
| Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024")) |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.
| configGet2 := client.ConfigGet(ctx, "max-key-size-in-cache") | |
| Expect(configGet2.Err()).NotTo(HaveOccurred()) | |
| Expect(configGet2.Val()).To(HaveKey("max-key-size-in-cache")) | |
| configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024") | |
| Expect(configSet1.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet1.Val()).To(Equal("OK")) | |
| configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576") | |
| Expect(configSet2.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet2.Val()).To(Equal("OK")) | |
| configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size") | |
| Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024")) | |
| configGet2 := client.ConfigGet(ctx, "max-key-size-in-cache") | |
| Expect(configGet2.Err()).NotTo(HaveOccurred()) | |
| Expect(configGet2.Val()).To(HaveKey("max-key-size-in-cache")) | |
| configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024") | |
| Expect(configSet1.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet1.Val()).To(Equal("OK")) | |
| configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576") | |
| Expect(configSet2.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet2.Val()).To(Equal("OK")) | |
| configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size") | |
| Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024")) |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.
| configGet2 := client.ConfigGet(ctx, "max-key-size-in-cache") | |
| Expect(configGet2.Err()).NotTo(HaveOccurred()) | |
| Expect(configGet2.Val()).To(HaveKey("max-key-size-in-cache")) | |
| configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024") | |
| Expect(configSet1.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet1.Val()).To(Equal("OK")) | |
| configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576") | |
| Expect(configSet2.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet2.Val()).To(Equal("OK")) | |
| configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size") | |
| Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024")) | |
| configGet2 := client.ConfigGet(ctx, "max-key-size-in-cache") | |
| Expect(configGet2.Err()).NotTo(HaveOccurred()) | |
| Expect(configGet2.Val()).To(HaveKey("max-key-size-in-cache")) | |
| configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024") | |
| Expect(configSet1.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet1.Val()).To(Equal("OK")) | |
| configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576") | |
| Expect(configSet2.Err()).NotTo(HaveOccurred()) | |
| Expect(configSet2.Val()).To(Equal("OK")) | |
| configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size") | |
| Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024")) |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing error check before accessing result. The error should be checked with Expect(configGet4.Err()).NotTo(HaveOccurred()) before accessing configGet4.Val() to prevent potential panics if the ConfigGet operation fails.
| configGet4 := client.ConfigGet(ctx, "max-key-size-in-cache") | |
| configGet4 := client.ConfigGet(ctx, "max-key-size-in-cache") | |
| Expect(configGet4.Err()).NotTo(HaveOccurred()) |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.