From f386c4fca339085b50d227111170913cc8f45387 Mon Sep 17 00:00:00 2001 From: Laszlo Fogas Date: Mon, 24 Jun 2019 09:25:21 +0200 Subject: [PATCH] Tests are deadlocking, probably sensitive to wait length --- cncd/logging/log_test.go | 4 ++-- cncd/pubsub/pub_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cncd/logging/log_test.go b/cncd/logging/log_test.go index 20d8e3d55..2c235297e 100644 --- a/cncd/logging/log_test.go +++ b/cncd/logging/log_test.go @@ -30,7 +30,7 @@ func TestLogging(t *testing.T) { logger.Tail(ctx, testPath, func(entry ...*Entry) { wg.Done() }) }() - <-time.After(time.Millisecond) + <-time.After(500 * time.Millisecond) wg.Add(4) go func() { @@ -45,7 +45,7 @@ func TestLogging(t *testing.T) { logger.Tail(ctx, testPath, func(entry ...*Entry) { wg.Done() }) }() - <-time.After(time.Millisecond) + <-time.After(500 * time.Millisecond) wg.Wait() cancel() diff --git a/cncd/pubsub/pub_test.go b/cncd/pubsub/pub_test.go index 574c0e673..007f3192d 100644 --- a/cncd/pubsub/pub_test.go +++ b/cncd/pubsub/pub_test.go @@ -30,7 +30,7 @@ func TestPubsub(t *testing.T) { broker.Subscribe(ctx, testTopic, func(message Message) { wg.Done() }) }() - <-time.After(time.Millisecond) + <-time.After(500 * time.Millisecond) if _, ok := broker.(*publisher).topics[testTopic]; !ok { t.Errorf("Expect topic registered with publisher") @@ -86,7 +86,7 @@ func TestSubscriptionClosed(t *testing.T) { wg.Done() }() - <-time.After(time.Millisecond) + <-time.After(500 * time.Millisecond) if _, ok := broker.(*publisher).topics[testTopic]; !ok { t.Errorf("Expect topic registered with publisher")