gomodule / redigo

Go client for Redis
Apache License 2.0
9.76k stars 1.25k forks source link

Run the redis test server with enable-debug-command #654

Closed elboulangero closed 10 months ago

elboulangero commented 1 year ago

This is required for Redis >= 7.x, cf. https://raw.githubusercontent.com/redis/redis/7.0/00-RELEASENOTES:

* MODULE and DEBUG commands disabled (protected) by default, for better security (#9920)

Without this patch, some unit tests fail:

=== RUN   TestLatency
    reply_test.go:256:
                Error Trace:    /<<PKGBUILDDIR>>/_build/src/github.com/gomodule/redigo/redis/reply_test.go:256
                Error:          Received unexpected error:
                                ERR DEBUG command not allowed. If the enable-debug-command option is set to "local", you can run it from a local connection, otherwise you need to set this option in the configuration file, and then restart the server.
                Test:           TestLatency
--- FAIL: TestLatency (0.00s)
=== RUN   TestLatencyHistories
    reply_test.go:304:
                Error Trace:    /<<PKGBUILDDIR>>/_build/src/github.com/gomodule/redigo/redis/reply_test.go:304
                Error:          Received unexpected error:
                                ERR DEBUG command not allowed. If the enable-debug-command option is set to "local", you can run it from a local connection, otherwise you need to set this option in the configuration file, and then restart the server.
                Test:           TestLatencyHistories
--- FAIL: TestLatencyHistories (0.00s)

I tried to cook a clean patch but I'm not very familiar with Go, so it's not perfect.

elboulangero commented 1 year ago

Thanks for the review and advice!

I applied your suggestions, then fixed the details to get it to build. I think it's good now.

stevenh commented 10 months ago

Sorry @elboulangero missed the notification for this, merged.

elboulangero commented 10 months ago

@stevenh no worries!