1
0
mirror of https://github.com/redis/go-redis.git synced 2025-12-18 23:34:11 +03:00

fix(queuedNewConn): protect against nil context (#3649)

This commit is contained in:
Nedyalko Dyakov
2025-12-16 15:06:35 +02:00
committed by GitHub
parent 4edf494293
commit 452eb3d15f
4 changed files with 126 additions and 1 deletions

View File

@@ -8870,11 +8870,15 @@ var _ = Describe("Commands", func() {
It("returns latencies", func() {
const key = "latency-monitor-threshold"
// reset all latencies first to ensure clean state
err := client.LatencyReset(ctx).Err()
Expect(err).NotTo(HaveOccurred())
old := client.ConfigGet(ctx, key).Val()
client.ConfigSet(ctx, key, "1")
defer client.ConfigSet(ctx, key, old[key])
err := client.Do(ctx, "DEBUG", "SLEEP", 0.01).Err()
err = client.Do(ctx, "DEBUG", "SLEEP", 0.01).Err()
Expect(err).NotTo(HaveOccurred())
result, err := client.Latency(ctx).Result()
@@ -8921,6 +8925,10 @@ var _ = Describe("Commands", func() {
It("reset latencies by add event name args", func() {
const key = "latency-monitor-threshold"
// reset all latencies first to ensure clean state
err := client.LatencyReset(ctx).Err()
Expect(err).NotTo(HaveOccurred())
old := client.ConfigGet(ctx, key).Val()
client.ConfigSet(ctx, key, "1")
defer client.ConfigSet(ctx, key, old[key])