Skip to content
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

chore: remove debug check #659

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 2 additions & 14 deletions redis/reply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"math"
"reflect"
"strconv"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -227,17 +226,6 @@ func TestSlowLog(t *testing.T) {
}
}

// debugCheck skips t if err indicates that DEBUG is not allowed,
// otherwise it fails if err is not nil.
func debugCheck(t *testing.T, err error) {
t.Helper()

if err != nil && strings.Contains(err.Error(), "ERR DEBUG command not allowed") {
t.Skip("DEBUG command not allowed")
}
require.NoError(t, err)
}

func TestLatency(t *testing.T) {
c, err := dial()
require.NoError(t, err)
Expand Down Expand Up @@ -265,7 +253,7 @@ func TestLatency(t *testing.T) {

// Sleep for 1ms to register a slow event.
_, err = c.Do("DEBUG", "SLEEP", 0.001)
debugCheck(t, err)
require.NoError(t, err)

result, err = c.Do("LATENCY", "LATEST")
require.NoError(t, err)
Expand Down Expand Up @@ -317,7 +305,7 @@ func TestLatencyHistories(t *testing.T) {

// Sleep for 1ms to register a slow event
_, err = c.Do("DEBUG", "SLEEP", 0.001)
debugCheck(t, err)
require.NoError(t, err)

result, err = c.Do("LATENCY", "HISTORY", "command")
require.NoError(t, err)
Expand Down