mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 12:15:43 +01:00
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.
This commit is contained in:
parent
75261f56bc
commit
709c35685e
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue