[wp-trac] [WordPress Trac] #31491: Enhance unit tests for persistent object caching

WordPress Trac noreply at wordpress.org
Fri Aug 21 21:34:53 UTC 2015


#31491: Enhance unit tests for persistent object caching
------------------------------+-----------------------
 Reporter:  ocean90           |       Owner:  ocean90
     Type:  enhancement       |      Status:  assigned
 Priority:  normal            |   Milestone:  4.4
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  needs-patch       |     Focuses:
------------------------------+-----------------------
Description changed by ocean90:

Old description:

> While running the tests with an object-cache.php drop-in (in this case
> [http://wordpress.org/extend/plugins/memcached/ Memcached]) I got some
> failing tests:
>
> {{{
> There were 6 failures:
>
> 1) Tests_Cache::test_wp_cache_init
> Failed asserting that two objects are equal.
> --- Expected
> +++ Actual
> @@ @@
>          'default' => Memcache Object (
> -            'connection' => resource(671) of type (memcache connection)
> +            'connection' => resource(670) of type (memcache connection)
>              '_failureCallback' => Array (...)
>          )
>      )
>      'stats' => Array (...)
>      'group_ops' => Array ()
>      'cache_enabled' => true
>      'default_expiration' => 0
>      'global_prefix' => 'wptests_'
>      'blog_prefix' => 'wptests_:'
>      'cache_hits' => null
>      'cache_misses' => null
>  )
>
> /srv/www/wp-develop/svn/tests/phpunit/tests/cache.php:284
>
> 2) Tests_Import_Import::test_small_import
> Failed asserting that 0 matches expected 6.
>
> /srv/www/wp-develop/svn/tests/phpunit/tests/import/import.php:170
>
> 3) Tests_Option_SiteTransient::test_the_basics
> Failed asserting that true is false.
>
> /srv/www/wp-develop/svn/tests/phpunit/tests/option/siteTransient.php:16
>
> 4) Tests_Option_Transient::test_the_basics
> Failed asserting that true is false.
>
> /srv/www/wp-develop/svn/tests/phpunit/tests/option/transient.php:16
>
> 5) Tests_Option_Transient::test_transient_data_with_timeout
> Failed asserting that false is equal to 1425119322 or is greater than
> 1425119322.
>
> /srv/www/wp-develop/svn/tests/phpunit/tests/option/transient.php:54
>
> 6) Tests_Option_Transient::test_transient_add_timeout
> Failed asserting that false is equal to 1425119222 or is greater than
> 1425119222.
>
> /srv/www/wp-develop/svn/tests/phpunit/tests/option/transient.php:81
>
> FAILURES!
> Tests: 3183, Assertions: 12576, Failures: 6, Skipped: 3.
> }}}
>

> We should enhance these tests to make them work with a persistent object
> cache.
>
> From @pento: "It'd be worth having a memcache variant of our Travis
> tests.". Sounds like a good idea to me.

New description:

 While running the tests with an object-cache.php drop-in (in this case
 [http://wordpress.org/extend/plugins/memcached/ Memcached]) I got some
 failing tests:

 {{{
 There were 6 failures:

 1) Tests_Cache::test_wp_cache_init
 Failed asserting that two objects are equal.
 --- Expected
 +++ Actual
 @@ @@
          'default' => Memcache Object (
 -            'connection' => resource(765) of type (memcache connection)
 +            'connection' => resource(764) of type (memcache connection)
              '_failureCallback' => Array (...)
          )
      )
      'stats' => Array (...)
      'group_ops' => Array ()
      'cache_enabled' => true
      'default_expiration' => 0
      'global_prefix' => 'wptests_'
      'blog_prefix' => 'wptests_:'
      'cache_hits' => null
      'cache_misses' => null
  )

 /srv/www/wp-develop/svn/tests/phpunit/tests/cache.php:284

 2) Tests_Import_Import::test_small_import
 Failed asserting that 0 matches expected 6.

 /srv/www/wp-develop/svn/tests/phpunit/tests/import/import.php:175

 3) Tests_Option_SiteTransient::test_the_basics
 Failed asserting that true is false.

 /srv/www/wp-develop/svn/tests/phpunit/tests/option/siteTransient.php:16

 4) Tests_Option_Transient::test_the_basics
 Failed asserting that true is false.

 /srv/www/wp-develop/svn/tests/phpunit/tests/option/transient.php:16

 5)
 Tests_Option_UpdateOption::test_should_set_autoload_yes_for_nonexistent_option_when_autoload_param_is_no
 Failed asserting that 42579 matches expected 42580.

 /srv/www/wp-develop/svn/tests/phpunit/tests/option/updateOption.php:88

 6)
 Tests_Option_UpdateOption::test_should_set_autoload_yes_for_nonexistent_option_when_autoload_param_is_false
 Failed asserting that 42586 matches expected 42587.

 /srv/www/wp-develop/svn/tests/phpunit/tests/option/updateOption.php:113

 FAILURES!
 Tests: 3938, Assertions: 15029, Failures: 6, Errors: 1, Skipped: 16.
 }}}


 We should enhance these tests to make them work with a persistent object
 cache.

 From @pento: "It'd be worth having a memcache variant of our Travis
 tests.". Sounds like a good idea to me.

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31491#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list