Skip to content

Time rounded to milliseconds instead of nanoseconds #193

@ilbertt

Description

@ilbertt

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!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions