Skip to content

Commit

Permalink
archiver: tests: fix test by calling NewContext()
Browse files Browse the repository at this point in the history
The mutex is otherwise uninitialized, so we need to ensure that we're
actually initializing it if we plan to test it.
  • Loading branch information
kevans91 committed May 8, 2020
1 parent 75261f5 commit 709c356
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions services/archiver/archiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ func releaseOneEntry(t *testing.T, inFlight []*ArchiveRequest) {
func TestArchive_Basic(t *testing.T) {
assert.NoError(t, models.PrepareTestDatabase())

// Create a new context here, because we may want to use locks or need other
// initial state here.
NewContext()
archiveQueueMutex = &queueMutex
archiveQueueStartCond = sync.NewCond(&queueMutex)
archiveQueueReleaseCond = sync.NewCond(&queueMutex)
Expand Down

0 comments on commit 709c356

Please sign in to comment.