From 585318d3075a3b7420c5e5b1f8b771fc2638f34e Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Sun, 26 Apr 2020 21:05:54 +0300 Subject: [PATCH] Another attempt to fix FullBus test --- mojangtextures/batch_uuids_provider_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mojangtextures/batch_uuids_provider_test.go b/mojangtextures/batch_uuids_provider_test.go index 39c6d8b..711a03c 100644 --- a/mojangtextures/batch_uuids_provider_test.go +++ b/mojangtextures/batch_uuids_provider_test.go @@ -236,8 +236,8 @@ func TestPeriodicStrategy(t *testing.T) { strategy.Queue(j) ctx, cancel := context.WithCancel(context.Background()) - ch := strategy.GetJobs(ctx) startedAt := time.Now() + ch := strategy.GetJobs(ctx) iteration := <-ch durationBeforeResult := time.Now().Sub(startedAt) require.True(t, durationBeforeResult >= d) @@ -371,9 +371,10 @@ func TestFullBusStrategy(t *testing.T) { d := 20 * time.Millisecond strategy := NewFullBusStrategy(d, 10) ctx, cancel := context.WithCancel(context.Background()) + + startedAt := time.Now() ch := strategy.GetJobs(ctx) - var startedAt time.Time done := make(chan struct{}) go func() { defer close(done) @@ -385,7 +386,6 @@ func TestFullBusStrategy(t *testing.T) { require.Equal(t, 0, iteration.Queue) }() - startedAt = time.Now() for _, j := range jobs { strategy.Queue(j) }