From d048ff2b9cd4146ac74c18c08bda660113f7e1b5 Mon Sep 17 00:00:00 2001 From: David Dreschner Date: Mon, 13 Jul 2026 07:11:36 +0200 Subject: [PATCH] chore(Memcached): Fix flaky tests Assisted-by: ClaudeCode:claude-sonnet-4.6 Signed-off-by: David Dreschner --- tests/lib/Memcache/MemcachedTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/lib/Memcache/MemcachedTest.php b/tests/lib/Memcache/MemcachedTest.php index ec9513988fd12..be2c97fd3217d 100644 --- a/tests/lib/Memcache/MemcachedTest.php +++ b/tests/lib/Memcache/MemcachedTest.php @@ -30,6 +30,13 @@ public static function setUpBeforeClass(): void { protected function setUp(): void { parent::setUp(); $this->instance = new Memcached($this->getUniqueID()); + // Flush the shared \Memcached singleton so that its internal result + // code is reset to RES_SUCCESS before the first get() of each test. + // Without this, a prior test that ended with a successful set/get + // leaves RES_SUCCESS in the singleton, and if the underlying library + // then returns false+RES_SUCCESS for a missing key the get() wrapper + // cannot tell the difference from a stored false value. + $this->instance->clear(); } #[\Override]