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

WordPress Trac noreply at wordpress.org
Sun Mar 22 14:43:35 UTC 2020


#30336: microtime returning a string causes false test failures
------------------------------+---------------------
 Reporter:  jorbin            |       Owner:  jorbin
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  4.1
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:  fixed
 Keywords:                    |     Focuses:
------------------------------+---------------------

Comment (by SergeyBiryukov):

 In [changeset:"47490" 47490]:
 {{{
 #!CommitTicketReference repository="" revision="47490"
 When asserting microtime output as a number, make it a number.

 microtime is by default a string. Doing a greater then or less than check
 of that string is a bad idea since it uses the first part (the micro part
 of microtime) rather then the actual time. This adds a helper to convert
 microtime output into a float which we can then use to properly compare
 the output of microtime.

 This fixes an intermittent test failure.

 Props jorbin.
 Merges [30337] to the 3.9 branch.
 See #30336, #49485.
 }}}

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


More information about the wp-trac mailing list