On Tue, Oct 16, 2012 at 6:34 AM,  <[email protected]> wrote:
> Hello Arnaud, Charles,
>
> regarding the nut_clock_* iface unit testing,
> I came to the following conclusion:
>
> 1/ It is IMO generally impossible to do deterministic
> unit test; the problem in question is inherently
> non-deterministic (I mean non-det. by nature).
> Justification: the main reason is that we can't
> perfectly predict the CPU time spent on computation,
> mainly because we have multi-tasking; there might
> be any number of context switches between almost
> any states, so if we measure time with us/ns precisions,
> we can't expect fitting times at that scale.

As I understand it, the more important thing to test is just whether a
timer fires in roughly the correct amount of time, rather than whether
it is precise. A tolerance of +/- 10% for times measured in seconds
should be good enough for catching obvious errors, without being
sensitive to system load.

-- 
- Charles Lepple

_______________________________________________
Nut-upsdev mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev

Reply via email to