[wp-trac] [WordPress Trac] #27410: Clear object cache between tests
WordPress Trac
noreply at wordpress.org
Sun Oct 19 23:22:09 UTC 2014
#27410: Clear object cache between tests
------------------------------+-------------------------
Reporter: rmccue | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Build/Test Tools | Version:
Severity: normal | Resolution: worksforme
Keywords: close | Focuses:
------------------------------+-------------------------
Changes (by rmccue):
* keywords: close reporter-feedback => close
* status: new => closed
* resolution: => worksforme
* milestone: Awaiting Review =>
Comment:
Replying to [comment:2 boonebgorges]:
> Strictly speaking, we should run it during `setUp()`, to be absolutely
sure that the cache is clean *before* each test is run. And, lo and
behold, we do!
https://core.trac.wordpress.org/browser/tags/4.0/tests/phpunit/includes/testcase.php#L39
>
> My guess is that you are not calling `parent::setUp()` in your test
class's `setUp()` method. It should be the first thing anytime you
override `WP_UnitTestCase::setUp()`. See eg
https://core.trac.wordpress.org/browser/tags/4.0/tests/phpunit/tests/post.php.
Aha. I am calling that, but the [https://wordpress.org/plugins/memcached/
canonical memcache extension] doesn't obey
[https://plugins.trac.wordpress.org/browser/memcached/trunk/object-
cache.php#L197 cache flushes] on multisite. Not entirely sure why.
(Also, weird that `flush_cache` reaches into the internals of the cache
implementation. Really not a fan of that.)
Closing for now, as I think this is a bug in the memcache object cache.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27410#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list