[wp-trac] [WordPress Trac] #38381: Race conditions in Tests_Date_I18n

WordPress Trac noreply at wordpress.org
Sat Oct 22 06:42:33 UTC 2016


#38381: Race conditions in Tests_Date_I18n
------------------------------+-------------------------
 Reporter:  pento             |       Owner:  swissspidy
     Type:  defect (bug)      |      Status:  assigned
 Priority:  low               |   Milestone:  4.7
Component:  Build/Test Tools  |     Version:
 Severity:  minor             |  Resolution:
 Keywords:  has-patch         |     Focuses:
------------------------------+-------------------------

Comment (by swissspidy):

 Replying to [comment:4 pento]:
 > To ensure consistent behaviour, the best option would be to get the
 output of `time()` at the start of each test, then pass it to the `date()`
 and `date_i18n()` calls, to ensure they're both generating from the same
 timestamp.

 But then I can't really test for the case where no timestamp is passed to
 the function. I mean, ideally we'd mock dates, but the delta comparison
 should work just as well.

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


More information about the wp-trac mailing list