From 71e94647cc669b8c7944193367cd3d6b72fb2e2e Mon Sep 17 00:00:00 2001 From: Vadim Dvorovenko Date: Fri, 21 Nov 2025 09:10:16 +0700 Subject: [PATCH 1/3] [12.x] unskip tests --- tests/Integration/Cache/RedisStoreTest.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/Integration/Cache/RedisStoreTest.php b/tests/Integration/Cache/RedisStoreTest.php index 42bbb5a02ff2..e4332b5b6b40 100644 --- a/tests/Integration/Cache/RedisStoreTest.php +++ b/tests/Integration/Cache/RedisStoreTest.php @@ -6,7 +6,6 @@ use Illuminate\Cache\RedisStore; use Illuminate\Foundation\Testing\Concerns\InteractsWithRedis; use Illuminate\Redis\Connections\PhpRedisClusterConnection; -use Illuminate\Redis\Connections\PredisClusterConnection; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Sleep; use Mockery as m; @@ -96,8 +95,6 @@ public function testItCanExpireWithZeroTTL() public function testTagsCanBeAccessed() { - $this->markTestSkippedWithPredisClusterConnection(); - Cache::store('redis')->clear(); Cache::store('redis')->tags(['people', 'author'])->put('name', 'Sally', 5); @@ -114,8 +111,6 @@ public function testTagsCanBeAccessed() public function testTagEntriesCanBeStoredForever() { - $this->markTestSkippedWithPredisClusterConnection(); - Cache::store('redis')->clear(); Cache::store('redis')->tags(['people', 'author'])->forever('name', 'Sally'); @@ -274,8 +269,6 @@ public function testIncrementWithSerializationEnabled() public function testTagsCanBeFlushedWithLargeNumberOfKeys() { - $this->markTestSkippedWithPredisClusterConnection(); - Cache::store('redis')->clear(); $tags = ['large-test-'.time()]; @@ -297,12 +290,4 @@ public function testTagsCanBeFlushedWithLargeNumberOfKeys() $keyCount = Cache::store('redis')->connection()->keys('*'); $this->assertCount(0, $keyCount); } - - protected function markTestSkippedWithPredisClusterConnection() - { - $this->markTestSkippedWhen( - $this->app['redis']->connection() instanceof PredisClusterConnection, - 'This test currently fails on Predis Cluster connection', - ); - } } From 377a62f53a4e586ec15b95974d488d8de38faae7 Mon Sep 17 00:00:00 2001 From: Vadim Dvorovenko Date: Sat, 8 Nov 2025 21:12:49 +0700 Subject: [PATCH 2/3] [12.x] flushValues for PredisCluster in RedisTaggedCache --- src/Illuminate/Cache/RedisTaggedCache.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Cache/RedisTaggedCache.php b/src/Illuminate/Cache/RedisTaggedCache.php index 7f4e30992a4a..61aaf735e890 100644 --- a/src/Illuminate/Cache/RedisTaggedCache.php +++ b/src/Illuminate/Cache/RedisTaggedCache.php @@ -193,8 +193,17 @@ protected function flushValues() ->map(fn (string $key) => $this->store->getPrefix().$key) ->chunk(1000); + $connection = $this->store->connection(); foreach ($entries as $cacheKeys) { - $this->store->connection()->del(...$cacheKeys); + if ($connection instanceof PredisClusterConnection) { + $connection->pipeline(function ($connection) use ($cacheKeys) { + foreach ($cacheKeys as $cacheKey) { + $connection->del($cacheKey); + } + }); + } else { + $connection->del(...$cacheKeys); + } } } From b938286da6bdea2ce450685aab72c036584dd870 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 21 Nov 2025 15:15:22 -0600 Subject: [PATCH 3/3] formatting --- src/Illuminate/Cache/RedisTaggedCache.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Illuminate/Cache/RedisTaggedCache.php b/src/Illuminate/Cache/RedisTaggedCache.php index 61aaf735e890..c95abe4e5235 100644 --- a/src/Illuminate/Cache/RedisTaggedCache.php +++ b/src/Illuminate/Cache/RedisTaggedCache.php @@ -194,6 +194,7 @@ protected function flushValues() ->chunk(1000); $connection = $this->store->connection(); + foreach ($entries as $cacheKeys) { if ($connection instanceof PredisClusterConnection) { $connection->pipeline(function ($connection) use ($cacheKeys) {