Actually, there is a debug sleep command which does exactly what you want. It is defined in the debug.c file as:
} else if (!strcasecmp(c->argv[1]->ptr,"sleep") && c->argc == 3) {
double dtime = strtod(c->argv[2]->ptr,NULL);
long long utime = dtime*1000000;
usleep(utime);
addReply(c,shared.ok);
} else {
Please note it blocks the whole Redis event loop (all the connections) contrary to BLPOP that would only block one connection.
> ./redis-cli debug sleep 2
... 2 seconds wait ...
OK
With BLPOP, you do not need a second thread since you can specify a timeout:
> ./redis-cli blpop dummy_key_which_does_not_exist 2
... 2 seconds wait ...
(nil)
Another way to make Redis unresponsive is to send STOP and CONT signals. Once you have the pid of the instance, just launch:
kill -STOP $pid
sleep 1
kill -CONT $pid
With this signal trick all the threads of the redis instance will be frozen (i.e. not only the event loop). This includes the I/O background threads.