From 9d3c1a5a330969ca0341e819107e3a3d3b8bb0e8 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 19 Aug 2020 16:23:57 +0100 Subject: [PATCH] Fix unit tests --- federationsender/statistics/statistics_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/federationsender/statistics/statistics_test.go b/federationsender/statistics/statistics_test.go index 9050662ec..f94861324 100644 --- a/federationsender/statistics/statistics_test.go +++ b/federationsender/statistics/statistics_test.go @@ -36,7 +36,10 @@ func TestBackoff(t *testing.T) { // completes but we will find out how long the backoff should // have been. interrupt := make(chan bool, 1) - close(interrupt) + go func() { + time.Sleep(10 * time.Millisecond) + close(interrupt) + }() // Get the duration. duration, blacklist := server.BackoffIfRequired(backingOff, interrupt)