diff -u b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php --- b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -532,7 +532,7 @@ $this->assertCount(0, $cache_items); } else { - $this->assertNotEmpty($cache_items); + $this->assertLessThanOrEqual(2, count($cache_items)); $found_cached_200_response = FALSE; $other_cached_responses_are_4xx = TRUE; foreach ($cache_items as $cache_item) {