Skip to content

Commit 709c356

Browse files
committed
archiver: tests: fix test by calling NewContext()
The mutex is otherwise uninitialized, so we need to ensure that we're actually initializing it if we plan to test it.
1 parent 75261f5 commit 709c356

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/archiver/archiver_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ func releaseOneEntry(t *testing.T, inFlight []*ArchiveRequest) {
7575
func TestArchive_Basic(t *testing.T) {
7676
assert.NoError(t, models.PrepareTestDatabase())
7777

78+
// Create a new context here, because we may want to use locks or need other
79+
// initial state here.
80+
NewContext()
7881
archiveQueueMutex = &queueMutex
7982
archiveQueueStartCond = sync.NewCond(&queueMutex)
8083
archiveQueueReleaseCond = sync.NewCond(&queueMutex)

0 commit comments

Comments
 (0)