Calling:
await pic.advanceTime(0);
can make the time go back in the "past" in PocketIC, which fails with this error:
PocketIC server encountered an error SettingTimeIntoPast((1761030480000000010, 1761030480000000000))
The reason is that the getTime method returns milliseconds, so when calling setTime inside the advanceTime method, the time is rounded to milliseconds, removing the microseconds and nanoseconds components.
I would prefer to leave the current getTime, setTime and advanceTime methods of the PocketIc class with milliseconds precision, and just fix the logic internally.
We can later introduce analogous methods handling nanoseconds precision upon demand.
Thanks to @peterpeterparker and @mraszyk for debugging!
Calling:
can make the time go back in the "past" in PocketIC, which fails with this error:
PocketIC server encountered an error SettingTimeIntoPast((1761030480000000010, 1761030480000000000))The reason is that the
getTimemethod returns milliseconds, so when callingsetTimeinside theadvanceTimemethod, the time is rounded to milliseconds, removing the microseconds and nanoseconds components.I would prefer to leave the current
getTime,setTimeandadvanceTimemethods of thePocketIcclass with milliseconds precision, and just fix the logic internally.We can later introduce analogous methods handling nanoseconds precision upon demand.
Thanks to @peterpeterparker and @mraszyk for debugging!