EventTimeSource 的 NewTimer 在 Reset 之后会送出旧时间
EventTimeSource 的 NewTimer 在 Reset 之后会送出旧时间: a task in MiMo-V2.6-RL-harbor-code: MiMo-V2.6-RL Code (Harbor) (Harbor dataset). 我在写单元测试时用 clock.NewEventTimeSource() 做 fake clock,通过 NewTimer 拿到 (<-chan time.Time, Timer) 来模拟一个会触发的定时器。我想在同一个 timer 上 fire 两次:先让它 fire 一次、读出时间、验证;然后 Reset 一个新的 duration,再…
The task
我在写单元测试时用 `clock.NewEventTimeSource()` 做 fake clock,通过 `NewTimer` 拿到 `(<-chan time.Time, Timer)` 来模拟一个会触发的定时器。我想在同一个 timer 上 fire 两次:先让它 fire 一次、读出时间、验证;然后 `Reset` 一个新的 duration,再 advance 时间让它第二次 fire,从 channel 里读出第二次的时间。
Part of FineEnvs/MiMo-V2.6-RL-harbor-code.