Skip to content

Commit ee32dd7

Browse files
committed
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.
1 parent a523235 commit ee32dd7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

sdjournal/journal_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,7 @@ func TestJournalGetEntry(t *testing.T) {
204204
t.Fatalf("Error writing to journal: %s", err)
205205
}
206206

207-
r := j.Wait(time.Duration(1) * time.Second)
208-
if r < 0 {
209-
t.Fatalf("Error waiting to journal")
210-
}
207+
time.Sleep(time.Duration(1) * time.Second)
211208

212209
n, err := j.Next()
213210
if err != nil {

0 commit comments

Comments
 (0)