Skip to content

Commit

Permalink
Add flaky constraint to random routes unit tests
Browse files Browse the repository at this point in the history
Also increase margin of error for guardian tests 5ms->10ms.
  • Loading branch information
ionutboangiu authored and danbogos committed Apr 16, 2024
1 parent 73c54cd commit 4964a46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions engine/libroutes_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build flaky

/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
Expand Down
4 changes: 2 additions & 2 deletions guardian/guardian_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4964a46

Please sign in to comment.