Skip to content

Commit b9fc4c0

Browse files
committed
fix flacky test
1 parent f32a30a commit b9fc4c0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

commands_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8870,11 +8870,15 @@ var _ = Describe("Commands", func() {
88708870
It("returns latencies", func() {
88718871
const key = "latency-monitor-threshold"
88728872

8873+
// reset all latencies first to ensure clean state
8874+
err := client.LatencyReset(ctx).Err()
8875+
Expect(err).NotTo(HaveOccurred())
8876+
88738877
old := client.ConfigGet(ctx, key).Val()
88748878
client.ConfigSet(ctx, key, "1")
88758879
defer client.ConfigSet(ctx, key, old[key])
88768880

8877-
err := client.Do(ctx, "DEBUG", "SLEEP", 0.01).Err()
8881+
err = client.Do(ctx, "DEBUG", "SLEEP", 0.01).Err()
88788882
Expect(err).NotTo(HaveOccurred())
88798883

88808884
result, err := client.Latency(ctx).Result()
@@ -8921,6 +8925,10 @@ var _ = Describe("Commands", func() {
89218925
It("reset latencies by add event name args", func() {
89228926
const key = "latency-monitor-threshold"
89238927

8928+
// reset all latencies first to ensure clean state
8929+
err := client.LatencyReset(ctx).Err()
8930+
Expect(err).NotTo(HaveOccurred())
8931+
89248932
old := client.ConfigGet(ctx, key).Val()
89258933
client.ConfigSet(ctx, key, "1")
89268934
defer client.ConfigSet(ctx, key, old[key])

0 commit comments

Comments
 (0)