[wp-trac] [WordPress Trac] #30336: microtime returning a string causes false test failures

WordPress Trac noreply at wordpress.org
Thu Nov 13 21:46:07 UTC 2014


#30336: microtime returning a string causes false test failures
------------------------------+-----------------
 Reporter:  jorbin            |      Owner:
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  4.1
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------
 One of the assertions inside test_get_pages_cache (and possibly elsewhere)
 is that when deleting a post, the last_changed time in the posts cache is
 greater then it was before deleting it.  The problem is that we are
 comparing microtime strings.

 So you end up with things like:

 {{{
 Failed asserting that '0.01805200 1415892888' is greater than '0.99591600
 1415892887'.
 }}}

 The problem is that it should be comparing 1415892888.018052 and
 1415892887.995916  which would cause the test to pass.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30336>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list