Description: Fix flaky tests
 dispatch_test.go: Apparently, some signal is being delivered a few
   microseconds too early. This patch allows for a 10% difference in timing.
Bug-Debian: https://bugs.debian.org/830936
Forwarded: https://github.com/prometheus/alertmanager/issues/427
Author: Martina Ferrari <tina@debian.org>
Last-Update: 2019-10-29

---
 dispatch/dispatch_test.go |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/dispatch/dispatch_test.go
+++ b/dispatch/dispatch_test.go
@@ -174,7 +174,7 @@ func TestAggrGroup(t *testing.T) {
 			lastCurMtx.Lock()
 			s := time.Since(last)
 			lastCurMtx.Unlock()
-			if s < opts.GroupInterval {
+			if s < opts.GroupInterval * 90 / 100 {
 				t.Fatalf("received batch too early after %v", s)
 			}
 			exp := removeEndsAt(types.AlertSlice{a1, a3})
@@ -224,7 +224,7 @@ func TestAggrGroup(t *testing.T) {
 			lastCurMtx.Lock()
 			s := time.Since(last)
 			lastCurMtx.Unlock()
-			if s < opts.GroupInterval {
+			if s < opts.GroupInterval * 90 / 100 {
 				t.Fatalf("received batch too early after %v", s)
 			}
 			exp := removeEndsAt(types.AlertSlice{a1, a2, a3})
@@ -252,7 +252,7 @@ func TestAggrGroup(t *testing.T) {
 		lastCurMtx.Lock()
 		s := time.Since(last)
 		lastCurMtx.Unlock()
-		if s < opts.GroupInterval {
+		if s < opts.GroupInterval * 90 / 100 {
 			t.Fatalf("received batch too early after %v", s)
 		}
 		sort.Sort(batch)
