Now() needs to be under test code control, for easier testing of things that need to be done hourly, daily, every weekday, etc.
Need to add a Now() call in the kernel that works with a "SetNow()" that should be in the atlanta.test area.
Now() should be implemented using the normal sys call machinery, but should respect SetNow if anybody has set the current time. SetNow() probably needs a flag also that says "freeze time" or not. If freeze time is true, then the clock stops running until the next SetNow() time.
The Now() machinery needs to also make sure that the start time of a call is recorded as what Now returns and that this gets passed via the pctx mechanism to downstream calls. This will require that upon receiving a call, receivers need to probably store the Now() value as an offset inside the pctx and then use the pctx for generating a timestamp on any log messages.
Now() needs to be under test code control, for easier testing of things that need to be done hourly, daily, every weekday, etc.
Need to add a
Now()
call in the kernel that works with a "SetNow()" that should be in the atlanta.test area.Now() should be implemented using the normal sys call machinery, but should respect SetNow if anybody has set the current time. SetNow() probably needs a flag also that says "freeze time" or not. If freeze time is true, then the clock stops running until the next SetNow() time.
The Now() machinery needs to also make sure that the start time of a call is recorded as what Now returns and that this gets passed via the pctx mechanism to downstream calls. This will require that upon receiving a call, receivers need to probably store the Now() value as an offset inside the pctx and then use the pctx for generating a timestamp on any log messages.