diff --git a/library.c b/library.c index 5749e96..c5f9820 100644 --- a/library.c +++ b/library.c @@ -1519,9 +1519,9 @@ redis_object_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, zval ZEND_ASSERT(ctx == PHPREDIS_CTX_PTR || ctx == PHPREDIS_CTX_PTR + 1); if (ctx == PHPREDIS_CTX_PTR) { - return redis_long_response(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, NULL, NULL); + return redis_long_response(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, z_tab, NULL); } else { - return redis_string_response(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, NULL, NULL); + return redis_string_response(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, z_tab, NULL); } } diff --git a/tests/RedisTest.php b/tests/RedisTest.php index 20aabf8..7f4ea91 100644 --- a/tests/RedisTest.php +++ b/tests/RedisTest.php @@ -941,13 +941,18 @@ class Redis_Test extends TestSuite $this->redis->del('notakey'); $this->assertTrue($this->redis->mset(['{idle}1' => 'beep', '{idle}2' => 'boop'])); - usleep(1100000); - $this->assertTrue($this->redis->object('idletime', '{idle}1') >= 1); - $this->assertTrue($this->redis->object('idletime', '{idle}2') >= 1); + usleep(2100000); + $this->assertTrue($this->redis->object('idletime', '{idle}1') >= 2); + $this->assertTrue($this->redis->object('idletime', '{idle}2') >= 2); $this->assertEquals(2, $this->redis->touch('{idle}1', '{idle}2', '{idle}notakey')); - $this->assertTrue($this->redis->object('idletime', '{idle}1') == 0); - $this->assertTrue($this->redis->object('idletime', '{idle}2') == 0); + $idle1 = $this->redis->object('idletime', '{idle}1'); + $idle2 = $this->redis->object('idletime', '{idle}2'); + + /* We're not testing if idle is 0 because CPU scheduling on GitHub CI + * potatoes can cause that to erroneously fail. */ + $this->assertTrue($idle1 < 2); + $this->assertTrue($idle2 < 2); } public function testKeys()