Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2023 at 15:26 UTC
Updated:
26 Sep 2023 at 21:54 UTC
Jump to comment: Most recent
Comments
Comment #3
mondrakeComment #4
mondrakeOn this.
Comment #5
mondrakeIMHO we should be able to instantiate
Timealso with no request stack. Yes having the request stack available is in the normal path with container injection, but you may want to have aTimeinstance available also in early bootstrap containers and/or unit tests whenrequest_pathservice is not a thing.That is clearly coming up in #3113971: Replace REQUEST_TIME in services.
Comment #6
mondrakeComment #7
mondrakeComment #8
spokjeDropped some minor, non-RTBC-blocking nits in the MR.
Not claiming to fully understand this, but the parts I do get make sense, moving to RTBC to lure core-committer eyes 'n brains to it.
Comment #9
mondrake@Spokje if you want, share your doubts and I will certainly try to address them - and if I can't then at least we make them shout :)
Comment #10
spokjeNo doubts, cause for the issue seems legit, also because many moons ago I worked on a related issue where tests went wrong on timing of Time.
Also can't come up with a better or even other way to do this, so I'm getting the popcorn and await the shouting ;)
Comment #12
quietone commentedI'm triaging RTBC issues.
After reading the IS and comments I don't see anything left to do. I did a scan of the comments in the patch and they all made sense.
Leaving at RTBC.
Comment #14
longwaveThis makes sense to me and I see no better way of doing it. It adds no new API, only changing the fallback return value in an edge case, which will help in a small number of tests.
Also not a fan of
sleep()in tests but as we are testing time itself here I also see no better way of doing that!Not backported to 10.1.x as this is a minor behaviour change and the REQUEST_TIME changes likely won't need to be backported either.
Committed 5427d50 and pushed to 11.x. Thanks!