File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -1276,15 +1276,13 @@ static void test_blocking_connection_timeouts(struct config config) {
1276
1276
redisContext * c ;
1277
1277
redisReply * reply ;
1278
1278
ssize_t s ;
1279
- const char * sleep_cmd = "DEBUG SLEEP 3 \r\n" ;
1280
- struct timeval tv ;
1279
+ const char * sleep_cmd = "DEBUG SLEEP 1 \r\n" ;
1280
+ struct timeval tv = {. tv_sec = 0 , . tv_usec = 10000 } ;
1281
1281
1282
1282
c = do_connect (config );
1283
1283
test ("Successfully completes a command when the timeout is not exceeded: " );
1284
1284
reply = redisCommand (c ,"SET foo fast" );
1285
1285
freeReplyObject (reply );
1286
- tv .tv_sec = 0 ;
1287
- tv .tv_usec = 10000 ;
1288
1286
redisSetTimeout (c , tv );
1289
1287
reply = redisCommand (c , "GET foo" );
1290
1288
test_cond (reply != NULL && reply -> type == REDIS_REPLY_STRING && memcmp (reply -> str , "fast" , 4 ) == 0 );
@@ -1302,8 +1300,6 @@ static void test_blocking_connection_timeouts(struct config config) {
1302
1300
sdsfree (c -> obuf );
1303
1301
c -> obuf = sdsempty ();
1304
1302
1305
- tv .tv_sec = 0 ;
1306
- tv .tv_usec = 10000 ;
1307
1303
redisSetTimeout (c , tv );
1308
1304
reply = redisCommand (c , "GET foo" );
1309
1305
#ifndef _WIN32
@@ -1316,7 +1312,7 @@ static void test_blocking_connection_timeouts(struct config config) {
1316
1312
freeReplyObject (reply );
1317
1313
1318
1314
// wait for the DEBUG SLEEP to complete so that Redis server is unblocked for the following tests
1319
- millisleep (3000 );
1315
+ millisleep (1100 );
1320
1316
} else {
1321
1317
test_skipped ();
1322
1318
}
You can’t perform that action at this time.
0 commit comments