Add flaky constraint to random routes unit tests

Also increase margin of error for guardian tests 5ms->10ms.
This commit is contained in:
ionutboangiu
2024-04-16 19:05:27 +03:00
committed by Dan Christian Bogos
parent 73c54cdcf2
commit 4964a462cf
2 changed files with 4 additions and 2 deletions

View File

@@ -52,8 +52,8 @@ func TestGuardianMultipleKeys(t *testing.T) {
sg.Wait()
execTime := time.Since(tStart)
want := 10 * time.Millisecond * time.Duration(maxIter)
if diff := execTime - want; diff < 0 || diff > 5*time.Millisecond {
t.Errorf("total Guard duration for %d iterations over %d keys=%v: got %v want %v (diff %v, margin 5ms)",
if diff := execTime - want; diff < 0 || diff > 10*time.Millisecond {
t.Errorf("total Guard duration for %d iterations over %d keys=%v: got %v want %v (diff %v, margin 10ms)",
maxIter, len(keys), keys, execTime, want, diff)
}
Guardian.lkMux.Lock()