From ee32dd7feeb5891d8e54f287123bb036ab237ca6 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Mon, 20 Jun 2016 11:58:41 +0200 Subject: [PATCH] sdjournal: fix a race in GetEntry test Hard-sleep instead of waiting for a journal event. This fixes a race due to waiting for any events but enumerating only matching ones. --- sdjournal/journal_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sdjournal/journal_test.go b/sdjournal/journal_test.go index 74284517..8e18abce 100755 --- a/sdjournal/journal_test.go +++ b/sdjournal/journal_test.go @@ -204,10 +204,7 @@ func TestJournalGetEntry(t *testing.T) { t.Fatalf("Error writing to journal: %s", err) } - r := j.Wait(time.Duration(1) * time.Second) - if r < 0 { - t.Fatalf("Error waiting to journal") - } + time.Sleep(time.Duration(1) * time.Second) n, err := j.Next() if err != nil {