Skip to content

Commit

Permalink
chore: remove debug check (#659)
Browse files Browse the repository at this point in the history
Remove debug check now we run the test server with debug enabled if
needed.
  • Loading branch information
stevenh committed Feb 3, 2024
1 parent 8b1c13e commit 9f0d2e9
Showing 1 changed file with 2 additions and 14 deletions.
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

0 comments on commit 9f0d2e9

Please sign in to comment.