Tune some code/test for Windows

Running test suite on a Windows VM, I notice several failures.
Updated the compute of the RTT to be at least 1ns. I think that
this is just an issue with the VM I am running, but that change
will have no impact for normal situations (since setting the rtt
to the very minimum duration (1ns) instead of 0) and will prevent
some tests from failing.

Because of those same timer granularity issues, I had to add some
delays between some actions in order for time.Sub()/Since() to
actually report something more than 0.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2019-11-21 14:32:46 -07:00
parent 679bedafd9
commit 63138509f7
11 changed files with 103 additions and 31 deletions

View File

@@ -30,7 +30,8 @@ func checkPrivledges(t *testing.T) {
defer eventlog.Remove(src)
if err := eventlog.InstallAsEventCreate(src, eventlog.Info|eventlog.Error|eventlog.Warning); err != nil {
if strings.Contains(err.Error(), "Access is denied") {
t.Skip("skipping: elevated privledges are required.")
// Skip this test because elevated privileges are required.
t.SkipNow()
}
// let the tests report other types of errors
}